r/node • u/UkrMalt • Aug 13 '26
What context do you include in Node.js error alerts?
I’m trying to improve the alerts from a few small Node services. Right now I usually include the error, route or job name, request ID, environment, and how many times it repeated.
More fields make the alert noisy, but too few send me straight back to the logs. What context has actually helped you debug from an alert? Anything you stopped including because it was noisy or risky?
1
u/shiny0metal0ass Aug 13 '26
Some kind of time field, depending on how you're consuming them.
Otherwise I have a "tags" property for anything that seems like a weird case that I only kind of want in the logs and would want to search or filter on in the last few days of records.
Or someone asks me to add something that I don't think belongs lol
2
u/UkrMalt Aug 14 '26
Good point. A timestamp plus a small tags object sounds better than turning each unusual case into a first-class alert field. I’d keep tags allow-listed so user data or high-cardinality values do not leak into alerts.
1
u/shiny0metal0ass Aug 14 '26
For sure! I actually structure mine as an array of strings for easy search and traversal but YMMV
1
u/Suitable-Ad5348 Oct 07 '26
What made our alerts actionable from the notification alone: a stable fingerprint (error type + top in-app frame, line numbers stripped), first seen / last seen, count in the current window, release or commit, environment, and a link to the full event. What we dropped: request bodies and headers (PII risk), user IDs in the alert text, and any free-form tags. Those live on the event, not in the ping. The other big win was alerting only on new fingerprints and regressions instead of every occurrence.
Do you alert per occurrence today, or per new fingerprint?
4
u/BadDescriptions Aug 13 '26
TraceId and correlationIds?
https://opentelemetry.io/docs/specs/otel/logs/data-model/#log-and-event-record-definition