Isolated scopes for each http request #5576
-
I'm using Sentry with koa framework. I can't use I tried creating separate Hubs for each request, but that's not an elegant solution, and besides, the console breadcrumbs broke. I tried creating a cloned Scope for each request using On this page I saw an example that used the Any other solutions? Best practices? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey! We recommend using Eventually we'll make the switch to async hooks: https://nodejs.org/api/async_hooks.html - but since we have to support Node 8, we're stuck with domains for now. |
Beta Was this translation helpful? Give feedback.
Hey! We recommend using
domains
. Although it's deprecated, it works quite well and is the foundation of our various server side integrations - it should work ootb with the SDK as well. See our usage in express:sentry-javascript/packages/node/src/handlers.ts
Line 158 in ccc51f3
Eventually we'll make the switch to async hooks: https://nodejs.org/api/async_hooks.html - but since we have to support Node 8, we're stuck with domains for now.