npm.io
0.7.0 • Published 3 years ago

koa-datadog

Licence
MIT
Version
0.7.0
Deps
1
Size
12 kB
Vulns
0
Weekly
0

koa-datadog

Datadog middleware for Koa

This is a fork of node-connect-datadog with modifications for Koa.

Usage

Add middleware immediately before your router.

import koaDatadog from 'koa-datadog';
import Koa from 'koa';

const app = new Koa();
app.use(koaDatadog({}));

Options

All options are optional.

  • dogstatsd hot-shots client. default = new require("hot-shots")()
  • stat string name for the stat. default = "node.express.router"
  • tags array of tags to be added to the histogram. default = []
  • routeboolean include route tag (koa-route and koa-router are supported). default = false.
  • path boolean include path tag. default = false
  • method boolean include http method tag. default = false
  • protocol boolean include protocol tag. default = false
  • response_code boolean include http response codes. default = false
  • delim string char to replace pipe char with in the route default = '-'

License

View the LICENSE file.

Keywords