You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGES.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,9 @@
1
1
CHANGELOG
2
2
=========
3
3
4
+
*@bdeitte Add documentation for OpenTelemetry Collector StatsD receiver compatibility
5
+
*@bdeitte Sanitize protocol-breaking characters in metric names and tags. Fixes #238. Characters like `|`, `:`, `\n`, `#`, and `,` in metric names or tags are now replaced with `_` to prevent malformed packets.
6
+
4
7
## 13.0.0 (2026-1-19)
5
8
6
9
*@bdeitte Breaking: Prefix and suffix now automatically include period separators if needed. If you specify `prefix: 'myapp'`, it will be normalized to `'myapp.'`. Similarly, `suffix: 'prod'` becomes `'.prod'`. This ensures metrics like `myapp.request.time` instead of `myapprequest.time`. If your prefix/suffix already includes the period, no change is needed.
Copy file name to clipboardExpand all lines: README.md
+58-13Lines changed: 58 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# hot-shots
2
2
3
-
A Node.js client for [Etsy](http://etsy.com)'s [StatsD](https://github.com/etsy/statsd)server, Datadog's [DogStatsD](http://docs.datadoghq.com/guides/dogstatsd/) server, and [InfluxDB's](http://influxdb.com)[Telegraf](https://github.com/influxdb/telegraf) StatsD server.
3
+
A Node.js client for Datadog's [DogStatsD](http://docs.datadoghq.com/guides/dogstatsd/) server, InfluxDB's [Telegraf](https://github.com/influxdb/telegraf) StatsD server, the OpenTelemetry Collector [StatsD receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/statsdreceiver), and Etsy's [StatsD](https://github.com/etsy/statsd) server.
4
4
5
5
This project was originally a fork off of [node-statsd](https://github.com/sivy/node-statsd). This project
6
6
includes all changes in the latest node-statsd and many additional changes, including:
@@ -264,18 +264,63 @@ The check method has the following API:
264
264
});
265
265
```
266
266
267
-
## DogStatsD and Telegraf functionality
268
-
269
-
Some of the functionality mentioned above is specific to DogStatsD or Telegraf. They will not do anything if you are using the regular statsd client.
270
-
* globalTags parameter- DogStatsD or Telegraf
271
-
* tags parameter- DogStatsD or Telegraf.
272
-
* telegraf parameter- Telegraf
273
-
* uds option in protocol parameter- DogStatsD
274
-
* histogram method- DogStatsD or Telegraf
275
-
* event method- DogStatsD
276
-
* check method- DogStatsD
277
-
* includeDatadogTelemetry parameter- DogStatsD
278
-
* telemetryFlushInterval parameter- DogStatsD
267
+
## DogStatsD, Telegraf, and OpenTelemetry functionality
268
+
269
+
Some of the functionality mentioned above is specific to certain backends and will not work with others.
270
+
271
+
* globalTags parameter - DogStatsD, Telegraf, or OpenTelemetry
272
+
* tags parameter - DogStatsD, Telegraf, or OpenTelemetry
273
+
* histogram method - DogStatsD, Telegraf, or OpenTelemetry
274
+
* telegraf parameter - Telegraf
275
+
* uds option in protocol parameter - DogStatsD
276
+
* distribution method - DogStatsD
277
+
* set / unique method - DogStatsD or Telegraf (not OpenTelemetry)
278
+
* event method - DogStatsD
279
+
* check method - DogStatsD
280
+
* timestamp option - DogStatsD
281
+
* includeDatadogTelemetry parameter - DogStatsD
282
+
* telemetryFlushInterval parameter - DogStatsD
283
+
284
+
## OpenTelemetry Collector Compatibility
285
+
286
+
hot-shots is compatible with the [OpenTelemetry Collector's StatsD receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/statsdreceiver). The following features work out of the box:
287
+
288
+
| Feature | hot-shots Method | OTel Support |
289
+
|---------|------------------|--------------|
290
+
| Counter |`increment()`, `decrement()`| Yes |
291
+
| Gauge |`gauge()`| Yes |
292
+
| Gauge delta (+/-) |`gaugeDelta()`| Yes |
293
+
| Timer |`timing()`| Yes (converted to gauge/summary/histogram) |
294
+
| Histogram |`histogram()`| Yes (treated as timer) |
295
+
| Sample rate | All methods | Yes |
296
+
| Tags | All methods | Yes |
297
+
298
+
Example configuration for OpenTelemetry Collector:
299
+
300
+
```javascript
301
+
var client =newStatsD({
302
+
host:'localhost',
303
+
port:8125,
304
+
protocol:'udp'// or 'tcp'
305
+
});
306
+
307
+
// These all work with OpenTelemetry
308
+
client.increment('requests');
309
+
client.gauge('queue_size', 100);
310
+
client.gaugeDelta('connections', 1);
311
+
client.timing('response_time', 250);
312
+
client.histogram('request_size', 1024);
313
+
```
314
+
315
+
## Sanitization
316
+
317
+
To prevent malformed packets, hot-shots automatically replaces protocol-breaking characters with underscores (`_`).
318
+
319
+
***Metric names**: `:`, `|`, `\n`
320
+
***Tag keys**: `:`, `|`, `,`, `\n`, plus `@` and `#` for StatsD/DogStatsD
321
+
***Tag values**: `|`, `,`, `\n`, plus `@` and `#` for StatsD/DogStatsD
322
+
323
+
Colons are allowed in tag values (e.g., `url:https://example.com:8080`).
0 commit comments