connect-datadog
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -7,2 +7,3 @@ var DD = require("node-dogstatsd").StatsD; | ||
var tags = options.tags || []; | ||
var response_code = options.response_code || false; | ||
@@ -31,2 +32,3 @@ return function (req, res, next) { | ||
if (options.protocol && req.protocol) { | ||
@@ -40,3 +42,9 @@ statTags.push("protocol:" + req.protocol); | ||
datadog.histogram(stat, (new Date() - req._startTime), 1, statTags); | ||
if (response_code) { | ||
statTags.push("response_code:" + res.statusCode); | ||
datadog.increment(stat + '.response_code.' + res.statusCode , 1, statTags); | ||
datadog.increment(stat + '.response_code.all' , 1, statTags); | ||
} | ||
datadog.histogram(stat + '.response_time', (new Date() - req._startTime), 1, statTags); | ||
}; | ||
@@ -43,0 +51,0 @@ |
{ | ||
"name": "connect-datadog", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Datadog middleware for Connect JS / Express", | ||
@@ -18,4 +18,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"node-dogstatsd": "0.0.4" | ||
"node-dogstatsd": "0.0.5" | ||
} | ||
} |
@@ -23,2 +23,3 @@ # node-connect-datadog | ||
* `protocol` *boolean* include protocol tag. `default = false` | ||
* `response_code` *boolean* include http response codes. `default = false` | ||
@@ -25,0 +26,0 @@ ## License |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3601
40
29
+ Addednode-dogstatsd@0.0.5(transitive)
- Removednode-dogstatsd@0.0.4(transitive)
Updatednode-dogstatsd@0.0.5