-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request isolation is broken when using Sentry v8 with existing OTel setup #13055
Comments
Hey, so your setup has a couple of issues. You write:
What docs did you follow to set this up? I am just asking because the docs I am aware of about a custom otel setup: https://docs.sentry.io/platforms/javascript/guides/node/tracing/instrumentation/opentelemetry/#using-a-custom-opentelemetry-setup explain a quite different setup:
When your setup is correct, can you try again? |
For OTel, I followed the official "getting started" documentation: https://opentelemetry.io/docs/languages/js/getting-started/nodejs/ For Sentry, I followed the "ESM (MJS)" docs under "installation methods": https://docs.sentry.io/platforms/javascript/guides/node/install/esm/.
Hmm, honestly, I didn't know those docs existed, but even then, I wouldn't say this is a "custom" OTel setup. This is a bog-standard setup from the official "getting started" documentation. I see the actual page says "If you already have OpenTelemetry set up yourself, you can also use your existing setup", which I guess applies here. But if that's the case, I would expect this to be part of the top-level setup instructions, not buried under "Set Up Tracing" (I don't use tracing, so this doesn't apply to me). Even the docs for All that said: adding just From looking at the |
Additional feedback from trying to get things working:
So, it seems like only sentry-javascript/packages/node/src/sdk/index.ts Lines 198 to 205 in a880712
|
Hey, yeah we are aware that our docs on this are not ideal and a bit buried as of now - we are currently reworking these docs here: getsentry/sentry-docs#10872 where all of this should become more prominent and clear, hopefully. Generally, also the other parts (sampler, propagator) are required for everything to work properly, even if you do not use tracing with Sentry. This is because we depend on this for trace propagation etc. to work as expected. The span processor is actually not needed when you do not use sentry for tracing - I will adjust the validation logic to reflect this: #13079 |
It's great to hear that improved docs are on the way!
This sentence doesn't make a whole lot of sense to me. Why do I care about Sentry's custom trace propagation if I'm not using Sentry tracing? |
Hey @nwalters512,
Trace propagation is still needed for automatically connecting different services, e.g. to find related errors in frontend + backend. So this applies even if you're not using Sentry for monitoring performance. |
Interesting! We don't use Sentry in a way that spans multiple services or frontend/backend, but that's good to know. This is exactly the kind of thing I'd hope to see in the updated documentation. |
Feel free to read over the updates and leave feedback: getsentry/sentry-docs#10872 |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.20.0
Framework Version
N/A
Link to Sentry event
N/A
SDK Setup/Reproduction Example
https://github.com/nwalters512/sentry-memory-leak-repro
This example uses a minimal Sentry + OTel setup, with code/structure being copied directly from the Sentry + OTel documentation.
Steps to Reproduce
npm install
npm run start
curl http://localhost:3000/
a few timesExpected Result
I would expect the log from each request to show just a single event processor. This would indicate that event processors aren't leaking between requests and thus that request isolation is working correctly.
Actual Result
Every time a request comes in, another event processor is added to the existing scope, indicating that the same scope is being shared among all events. In practice, this will lead to a memory leak, since the array of event processors will grow without bounds.
The text was updated successfully, but these errors were encountered: