Conversation

s1gr1d

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

closes #16291

@s1gr1ds1gr1d requested review from mydea and Lms24 May 16, 2025 09:32
@github-actionsGitHub Actions

size-limit report 📦

PathSize% ChangeChange
@sentry/browser24.04 kB--
@sentry/browser - with treeshaking flags23.7 kB--
@sentry/browser (incl. Tracing)38.46 kB--
@sentry/browser (incl. Tracing, Replay)76.58 kB--
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags69.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/react25.86 kB--
@sentry/react (incl. Tracing)40.48 kB--
@sentry/vue28.44 kB--
@sentry/vue (incl. Tracing)40.28 kB--
@sentry/svelte24.07 kB--
CDN Bundle25.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 - uncompressed74.08 kB+0.55%+398 B 🔺
CDN Bundle (incl. Tracing) - uncompressed114.25 kB+0.16%+175 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed228.22 kB+0.08%+175 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed241.05 kB+0.08%+175 B 🔺
@sentry/nextjs (client)42.08 kB--
@sentry/sveltekit (client)38.95 kB--
@sentry/node158.16 kB-0.01%-2 B 🔽
@sentry/node - without tracing98.07 kB-0.01%-2 B 🔽
@sentry/aws-serverless123.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

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

Successfully merging this pull request may close these issues.

Implement strictTraceContinuation handling