# node-dogstatsd

> node client for extended StatsD server of Datadog

Latest version **0.0.7** (published 2017-12-22) · 0 weekly downloads

## Install

```sh
npm install node-dogstatsd
pnpm add node-dogstatsd
yarn add node-dogstatsd
bun add node-dogstatsd
```

## Health

**Score 18/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2017-12-22 |
| First published | 2012-09-09 |
| Weekly downloads | 0 |
| TypeScript types | separate (@types/node-dogstatsd) |
| Module format | CommonJS |
| Node | >=0.1.97 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Young Han Lee |
| Maintainers | joskuijpers, joybro |

## Links

- npm: https://www.npmjs.com/package/node-dogstatsd
- Repository: https://github.com/joybro/node-dogstatsd
- Homepage: https://github.com/joybro/node-dogstatsd#readme
- Issues: https://github.com/joybro/node-dogstatsd/issues
- npm.io page: https://npm.io/package/node-dogstatsd

## Recent versions

- 0.0.7 (latest) — 2017-12-22
- 0.0.6 — 2015-01-15
- 0.0.5 — 2014-04-30
- 0.0.4 — 2012-10-21
- 0.0.3 — 2012-10-19
- 0.0.2 — 2012-10-17
- 0.0.1 — 2012-09-09

## README

# node-dogstatsd

A node.js client for extended StatsD server of [Datadog](http://www.datadoghq.com).

Datadog added new some features(histogram and tags) to their own StatsD implementation.
This client is an extension of general StatsD client to work with that server.

Most parts of codes came from [Steve Ivy](https://github.com/sivy)'s [node-statsd](https://github.com/sivy/node-statsd).
I just added few lines to support datadog's histogram and tags features.

The name of the package is changed because this isn't really statsd client and should be able to be used with original statsd client.

    % npm install node-dogstatsd
    % node
    > var StatsD = require('node-dogstatsd').StatsD
    > c = new StatsD('example.org',8125)
    { host: 'example.org', port: 8125 }
    > c.increment('node_test.int')
    > c.incrementBy('node_test.int', 7)
    > c.decrement('node_test.int')
    > c.decrementBy('node_test.int', 12)
    > c.timing('node_test.some_service.task.time', 500) // time in millis
    > c.histogram('node_test.some_service.data', 100) // works only with datadog' StatsD
    > c.increment('node_test.int', 1, ['tag:one']) // works only with datadog' StatsD

## License

node-statsd is licensed under the MIT license.

## Error handling policy

* exceptions "bubble up" into the app that uses this library
* we don't log or print to console any errors ourself, it's the toplevel app that decides how to log/write to console.
* we document which exceptions can be raised, and where. (TODO, https://github.com/sivy/node-statsd/issues/17)

in your main app, you can leverage the fact that you have access to c.socket and do something like:
(this is the best way I've found so far)

    c.socket.on('error', function (exception) {
       return console.log ("error event in socket.send(): " + exception);
    });

---
_Source: https://npm.io/package/node-dogstatsd · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
