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
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,12 @@
1
1
CHANGELOG
2
2
=========
3
3
4
+
## 13.1.0 (2026-1-24)
5
+
4
6
*@bdeitte Add documentation for OpenTelemetry Collector StatsD receiver compatibility
5
7
*@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.
8
+
*@bdeitte Document how to handle metrics on shutdown
9
+
*@bdeitte Prevent "socket ended" errors and handle the client disconnection errors more gracefully. Fixes #247
Copy file name to clipboardExpand all lines: README.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -350,6 +350,46 @@ it is probably because you are sending large volumes of metrics to a single agen
350
350
This error only arises when using the UDS protocol and means that packages are being dropped.
351
351
Take a look at the [Datadog docs](https://docs.datadoghq.com/developers/dogstatsd/high_throughput/?#over-uds-unix-domain-socket) for some tips on tuning your connection.
352
352
353
+
### Sending metrics during process shutdown
354
+
355
+
Metrics sent from `process.on('exit')` handlers will **not** be delivered. This is a fundamental Node.js limitation, not a bug in hot-shots. When the `exit` event fires, the event loop has stopped processing async operations, so socket send callbacks will never execute.
356
+
357
+
The same applies to `process.on('uncaughtExceptionMonitor')` since that handler is also synchronous.
358
+
359
+
**Alternatives that work:**
360
+
361
+
Use `beforeExit` for graceful shutdown (fires when event loop is empty but before exit):
362
+
```javascript
363
+
process.on('beforeExit', (code) => {
364
+
client.increment('app.shutdown');
365
+
client.close();
366
+
});
367
+
```
368
+
369
+
Use signal handlers for external shutdown requests:
0 commit comments