chore: Add request-id to error tracking

This commit is contained in:
Tom Moor
2020-05-10 16:24:34 -07:00
parent 48c87a1902
commit 5deec264bc

View File

@@ -105,6 +105,10 @@ app.on('error', (error, ctx) => {
if (process.env.SENTRY_DSN) {
Sentry.withScope(function(scope) {
const requestId = ctx.headers['x-request-id'];
if (requestId) {
scope.setTag('request_id', requestId);
}
scope.addEventProcessor(function(event) {
return Sentry.Handlers.parseRequest(event, ctx.request);
});