0.0.9 • Published 9 years ago
@whollacsek/connect-datadog v0.0.9
node-connect-datadog
Datadog middleware for Connect JS / Express
Usage
Add middleware immediately before your router.
app.use(require("connect-datadog")({})); app.use(app.router);
Options
All options are optional.
dogstatsdnode-dogstatsd client.default = new (require("node-dogstatsd")).StatsD()statstring name for the stat.default = "node.express.router"tagsarray of tags (or function returning array of tags) to be added to the histogram.default = [](req, res) => { // set tags dynamically return ['key:value'] }sampleRatenumber sends only a sample of data to StatsDdefault: 1pathboolean include path tag.default = falsemethodboolean include http method tag.default = falseprotocolboolean include protocol tag.default = falseresponse_codeboolean include http response codes.default = falsestatsCallbackfunction callback hook that provides the following params(datadog, stat, sampleRate, statTags, req, res) => { // increment coolthing datadog.increment(`${stat}.coolthing`, sampleRate, statTags); }
License
View the LICENSE file.
0.0.9
9 years ago