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

[Fixes #16] no more hardcoded localhost #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ Add middleware immediately before your router.

All options are optional.

* `dogstatsd` node-dogstatsd client. `default = new require("node-dogstatsd").StatsD()`
* `dogstatsd_host` *string* host for node-dogstatsd client. `default = localhost`;
* `dogstatsd_port` *number* port for node-dogstatsd client. `default = 8125`;
* `dogstatsd` node-dogstatsd client. `default = new require("node-dogstatsd").StatsD(dogstatsd_host, dogstatsd_port)`
* `stat` *string* name for the stat. `default = "node.express.router"`
* `tags` *array* of tags to be added to the histogram. `default = []`
* `path` *boolean* include path tag. `default = false`
Expand Down
4 changes: 3 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const hotShots = require("hot-shots");

module.exports = function (options) {
let datadog = options.dogstatsd || new hotShots.StatsD("localhost", 8125);
let dogstatsd_host = options.dogstatsd_host || "localhost";
let dogstatsd_port = options.dogstatsd_port || 8125;
let datadog = options.dogstatsd || new hotShots.StatsD(dogstatsd_host, dogstatsd_port);
let stat = options.stat || "node.express.router";
let tags = options.tags || [];
let path = options.path || false;
Expand Down