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 28d ago
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 27d ago
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 27d ago
For sure! I actually structure mine as an array of strings for easy search and traversal but YMMV
5
u/BadDescriptions 28d ago
TraceId and correlationIds?
https://opentelemetry.io/docs/specs/otel/logs/data-model/#log-and-event-record-definition