Skip to content

feat(core): Implement strictTraceContinuation #16313

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

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented May 16, 2025

This implements strictTraceContinuation based on those docs: https://develop.sentry.dev/sdk/telemetry/traces/#stricttracecontinuation

closes #16291

@s1gr1d s1gr1d requested review from mydea and Lms24 May 16, 2025 09:32
Copy link
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.04 kB - -
@sentry/browser - with treeshaking flags 23.7 kB - -
@sentry/browser (incl. Tracing) 38.46 kB - -
@sentry/browser (incl. Tracing, Replay) 76.58 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.61 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 81.35 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 93.46 kB - -
@sentry/browser (incl. Feedback) 40.83 kB - -
@sentry/browser (incl. sendFeedback) 28.79 kB - -
@sentry/browser (incl. FeedbackAsync) 33.66 kB - -
@sentry/react 25.86 kB - -
@sentry/react (incl. Tracing) 40.48 kB - -
@sentry/vue 28.44 kB - -
@sentry/vue (incl. Tracing) 40.28 kB - -
@sentry/svelte 24.07 kB - -
CDN Bundle 25.39 kB +0.55% +138 B 🔺
CDN Bundle (incl. Tracing) 38.64 kB +0.26% +99 B 🔺
CDN Bundle (incl. Tracing, Replay) 74.43 kB +0.16% +114 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 79.87 kB +0.14% +109 B 🔺
CDN Bundle - uncompressed 74.08 kB +0.55% +398 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 114.25 kB +0.16% +175 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 228.22 kB +0.08% +175 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 241.05 kB +0.08% +175 B 🔺
@sentry/nextjs (client) 42.08 kB - -
@sentry/sveltekit (client) 38.95 kB - -
@sentry/node 158.16 kB -0.01% -2 B 🔽
@sentry/node - without tracing 98.07 kB -0.01% -2 B 🔽
@sentry/aws-serverless 123.41 kB -0.01% -1 B 🔽

View base workflow run

const incomingDsc = baggageHeaderToDynamicSamplingContext(baggage);
const baggageOrgId = incomingDsc?.org_id;

let sdkOrgId: string | undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m: I think we should use the same logic here as for injecting the org id, which is use the specified one if defined, else extract it from dsn? We may also put this into a reusable utility, I suppose!

sdkOrgId = extractOrgIdFromDsnHost(dsn.host);
}

const shouldStartNewTrace = (): boolean => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: Let's maybe make this a separate function that takes arguments instead of inlining this function? No strong feelings, but this is how we usually do this I suppose 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah no strong opinions about this. Just thought it's not a lot of logic and when inlining this it does not disrupt you from the code-reading flow but it still keeps this part of the code separated :D

@s1gr1d s1gr1d marked this pull request as draft May 16, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement strictTraceContinuation handling
2 participants