We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 26127f3 + 7af9e3b commit ce2eea7Copy full SHA for ce2eea7
1 file changed
lib/instrument-middleware.js
@@ -10,10 +10,10 @@ module.exports = function instrumentMiddleware (relativePath) {
10
// Check if the middleware is an async function, to use the appropriate timer
11
const isAsyncFunction = middleware.constructor.name === 'AsyncFunction'
12
13
- // Name it `middleware.<filename>`
14
- const name = `middleware.${path.basename(relativePath)}`
+ // Add a tag so we can see all middleware together
+ const tags = { middleware: path.basename(relativePath) }
15
16
return isAsyncFunction
17
- ? statsd.asyncTimer(middleware, name)
18
- : statsd.timer(middleware, name)
+ ? statsd.asyncTimer(middleware, 'middleware', tags)
+ : statsd.timer(middleware, 'middleware', tags)
19
}
0 commit comments