Skip to content

fix(node): UnifygetDynamicSamplingContextFromSpan #12522

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

Merged
merged 3 commits into from
Jun 19, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented Jun 18, 2024

We used to have a different implementation, that worked slightly different.

This had two problems:

  1. We did not look up the root span in the OTEL implementation, but relied on already passing in the root span (in core, we convert it to root span)
  2. We did not use frozen DSC properly

Now, the core implementation just works for both OTEL and core spans.

While at this, it also aligns the behavior of looking at the source of a span for DSC. Now, only if the source is url we'll not set the transaction on the DSC - previously, if no source was set at all, we'd also skip this. But conceptually "no source" is similar to "custom", which we do allow, so now this is a bit simpler.

Fixes #12508

@mydea mydea requested review from lforst, s1gr1d and andreiborza June 18, 2024 08:46
@mydea mydea self-assigned this Jun 18, 2024
Copy link
Contributor

github-actions bot commented Jun 18, 2024

size-limit report 📦

Path Size
@sentry/browser 22.22 KB (+0.89% 🔺)
@sentry/browser (incl. Tracing) 33.27 KB (+0.13% 🔺)
@sentry/browser (incl. Tracing, Replay) 69.05 KB (+0.08% 🔺)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.37 KB (+0.1% 🔺)
@sentry/browser (incl. Tracing, Replay with Canvas) 73.11 KB (+0.07% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback) 85.27 KB (+0.06% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 87.09 KB (+0.06% 🔺)
@sentry/browser (incl. metrics) 26.42 KB (+0.69% 🔺)
@sentry/browser (incl. Feedback) 38.42 KB (+0.47% 🔺)
@sentry/browser (incl. sendFeedback) 26.85 KB (+0.75% 🔺)
@sentry/browser (incl. FeedbackAsync) 31.42 KB (+0.63% 🔺)
@sentry/react 24.96 KB (+0.74% 🔺)
@sentry/react (incl. Tracing) 36.32 KB (+0.12% 🔺)
@sentry/vue 26.23 KB (+0.66% 🔺)
@sentry/vue (incl. Tracing) 35.13 KB (+0.13% 🔺)
@sentry/svelte 22.35 KB (+0.82% 🔺)
CDN Bundle 23.41 KB (+0.23% 🔺)
CDN Bundle (incl. Tracing) 34.95 KB (+0.13% 🔺)
CDN Bundle (incl. Tracing, Replay) 69.08 KB (+0.07% 🔺)
CDN Bundle (incl. Tracing, Replay, Feedback) 74.25 KB (+0.07% 🔺)
CDN Bundle - uncompressed 68.76 KB (+0.11% 🔺)
CDN Bundle (incl. Tracing) - uncompressed 103.41 KB (+0.07% 🔺)
CDN Bundle (incl. Tracing, Replay) - uncompressed 213.88 KB (+0.04% 🔺)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 226.47 KB (+0.03% 🔺)
@sentry/nextjs (client) 36.2 KB (+0.08% 🔺)
@sentry/sveltekit (client) 33.9 KB (+0.11% 🔺)
@sentry/node 112.62 KB (-0.04% 🔽)
@sentry/node - without tracing 90.04 KB (-0.04% 🔽)
@sentry/aws-serverless 99.12 KB (-0.04% 🔽)

mydea added 2 commits June 19, 2024 09:28
We used to have a different implementation, that worked slightly different.

This had two problems:

1. We did not look up the root span in the OTEL implementation, but relied on already passing in the root span (in core, we convert it to root span)
2. We did not use frozen DSC properly

Now, the core implementation just works for both OTEL and core spans.
@mydea mydea force-pushed the fn/fix-otel-dsc-from-span branch from 5e627d9 to c722213 Compare June 19, 2024 07:28
@mydea mydea force-pushed the fn/fix-otel-dsc-from-span branch from ccd40b2 to 4cdadc4 Compare June 19, 2024 08:54
@mydea mydea enabled auto-merge (squash) June 19, 2024 09:18
@mydea mydea merged commit 9724ec1 into develop Jun 19, 2024
113 checks passed
@mydea mydea deleted the fn/fix-otel-dsc-from-span branch June 19, 2024 09:22
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.

Astro SSR trace propagation doesn't work
2 participants