Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.

Commit 9390c99

Browse files
add option to add tags to all stats
1 parent cf06e87 commit 9390c99

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var DD = require("node-dogstatsd").StatsD;
33
module.exports = function (options) {
44
var datadog = options.dogstatsd || new DD();
55
var stat = options.stat || "node.express.router";
6+
var tags = options.tags || [];
67

78
return function (req, res, next) {
89
if (!req._startTime) {
@@ -21,7 +22,7 @@ module.exports = function (options) {
2122
datadog.histogram(stat, (new Date() - req._startTime), 1, [
2223
"route:" + req.route.path,
2324
"path:" + req.path
24-
]);
25+
].concat(tags));
2526
};
2627

2728
next();

0 commit comments

Comments
 (0)