chore: Add request-id to error tracking
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user