Skip to content

Commit ce2eea7

Browse files
authored
repo sync
2 parents 26127f3 + 7af9e3b commit ce2eea7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/instrument-middleware.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ module.exports = function instrumentMiddleware (relativePath) {
1010
// Check if the middleware is an async function, to use the appropriate timer
1111
const isAsyncFunction = middleware.constructor.name === 'AsyncFunction'
1212

13-
// Name it `middleware.<filename>`
14-
const name = `middleware.${path.basename(relativePath)}`
13+
// Add a tag so we can see all middleware together
14+
const tags = { middleware: path.basename(relativePath) }
1515

1616
return isAsyncFunction
17-
? statsd.asyncTimer(middleware, name)
18-
: statsd.timer(middleware, name)
17+
? statsd.asyncTimer(middleware, 'middleware', tags)
18+
: statsd.timer(middleware, 'middleware', tags)
1919
}

0 commit comments

Comments
 (0)