Hey there,
I've been looking around the issues here for quite some time, but I only find some dirty work-arounds or solution where you would need to rewrite half of your application to have access to the scope inside of middlewares or route handlers.
I want to enrich all Sentry events based on the request they are thrown/reported in and not globally set some values that get changed by other async requests on the same server.
e.g.
- Adding a client version (custom header value) as a tag to the scope
- Using scope.setExtras in a request that is causing weird issues and we want to debug (without wrapping everything inside of Sentry.withScope and try/catch
Afaik there is nothing yet like req.sentryScope, but it seems "relatively easy" to just add req.sentryScope = scope before this line.
If so, it should help people that are having issues with async scopes inside their express apps.
Do you see any downsides or problems with the described solution?
Hey there,
I've been looking around the issues here for quite some time, but I only find some dirty work-arounds or solution where you would need to rewrite half of your application to have access to the scope inside of middlewares or route handlers.
I want to enrich all Sentry events based on the request they are thrown/reported in and not globally set some values that get changed by other async requests on the same server.
e.g.
Afaik there is nothing yet like req.sentryScope, but it seems "relatively easy" to just add
req.sentryScope = scopebefore this line.If so, it should help people that are having issues with async scopes inside their express apps.
Do you see any downsides or problems with the described solution?