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

Commit 7224fdc

Browse files
committed
introduce statuscodes
1 parent 606c4ad commit 7224fdc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ All options are optional.
2020
* `path` *boolean* include path tag. `default = true`
2121
* `method` *boolean* include http method tag. `default = false`
2222
* `protocol` *boolean* include protocol tag. `default = false`
23-
* `statusCode` *boolean* include status codes. `default = false`
23+
* `response_code` *boolean* include http response codes. `default = false`
2424

2525
## License
2626

lib/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = function (options) {
44
var datadog = options.dogstatsd || new DD();
55
var stat = options.stat || "node.express.router";
66
var tags = options.tags || [];
7-
var statusCode = options.statusCode || false;
7+
var response_code = options.response_code || false;
88

99
return function (req, res, next) {
1010
if (!req._startTime) {
@@ -38,8 +38,8 @@ module.exports = function (options) {
3838
}
3939

4040
if (statuscode) {
41-
statTags.push("status_code:" + req.statusCode);
42-
datadog.increment(stat + '.status_code.' + req.statusCode , 1, statTags);
41+
statTags.push("response_code:" + req.statusCode);
42+
datadog.increment(stat + '.response_code.' + req.statusCode , 1, statTags);
4343
}
4444

4545
datadog.histogram(stat + '.response_time', (new Date() - req._startTime), 1, statTags);

0 commit comments

Comments
 (0)