-
-
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
fix(core): Remove sampled
flag from dynamic sampling context in Tracing without Performance mode
#13753
fix(core): Remove sampled
flag from dynamic sampling context in Tracing without Performance mode
#13753
Conversation
…hout Performance mode
sampled
flag from baggage meta tag in Tracing without Performance modesampled
flag from baggage
meta tag in Tracing without Performance mode
sampled
flag from baggage
meta tag in Tracing without Performance modesampled
flag from dynamic sampling context in Tracing without Performance mode
@@ -27,5 +27,6 @@ describe('getTraceMetaTags', () => { | |||
expect(sentryBaggageContent).toContain('sentry-environment=production'); | |||
expect(sentryBaggageContent).toContain('sentry-public_key=public'); | |||
expect(sentryBaggageContent).toContain(`sentry-trace_id=${traceId}`); | |||
expect(sentryBaggageContent).not.toContain('sentry-sampled='); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assertion failed before the change in this PR
size-limit report 📦
|
metaTags: Sentry.getTraceMetaTags(), | ||
}, | ||
}; | ||
if (!event.contexts.traceData) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this change necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, two of the tests have become so similar that I'll just remove the beforeSend hook and one of the tests.
|
||
expect(traceData.metaTags).toContain(`<meta name="sentry-trace" content="${trace_id}-${span_id}"/>`); | ||
expect(traceData.metaTags).toContain(`sentr y-trace_id=${trace_id}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how did that pass before? 😅 oops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it "passed" because the test function was async but it should have been sync and passed done
to the runner. So I guess the assertion failed eventually but at that point the test already passed and we never saw any failing logs 😬
This PR fixes a bug in Core that surfaced in Node apps configured for Tracing without Performance.
Previously, we'd incorrectly add
sampled: false
flag when creating the DSC from an active span if the application was configured for TwP. This is possible because in TwP, Otel still emits non-recording spans for the incoming requests. Our implementation in Core didn't account for this edge case yet.This PR also adds a regression test and fixes some previously incorrectly passing tests.