Skip to content
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

ref(tracing): Add necessary helpers for using propagation context on outgoing headers #8434

Merged
merged 9 commits into from
Jul 1, 2023

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Jun 29, 2023

experiments here: #8433

In preparation for Part 3 of #8352 (which involves creating sentry-trace/baggage when a span does not exist and attaching them to outgoing requests/meta tags), this PR adds some helpers. Notably it adds:

  1. A getter for PropagationContext on the scope
  2. generateSentryTraceHeader, which will be used to dynamically create sentry-trace headers, regardless of if there is a span or not
  3. getDynamicSamplingContextFromClient, which is used to generate dynamic sampling context from a client directly (instead of having to go through a transaction)

This PR also updates extractTraceparentData and dynamicSamplingContextToSentryBaggageHeader to be more liberal about the values it takes so we can better accommodate the new flows we are going to add.

Next up - we're updating Undici/Node HTTP! Then we move on to Next.js, Remix, Sveltekit, Serverless - and we should be good to go 🚀

@AbhiPrasad AbhiPrasad requested a review from a team June 29, 2023 23:08
@AbhiPrasad AbhiPrasad self-assigned this Jun 29, 2023
@AbhiPrasad AbhiPrasad requested review from mydea and Lms24 and removed request for a team June 29, 2023 23:08
@github-actions
Copy link
Contributor

github-actions bot commented Jun 29, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 21.79 KB (+0.08% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 68.55 KB (+0.16% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 20.1 KB (+0.1% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 59.79 KB (+0.14% 🔺)
@sentry/browser - Webpack (gzipped + minified) 21.71 KB (+0.12% 🔺)
@sentry/browser - Webpack (minified) 70.93 KB (+0.14% 🔺)
@sentry/react - Webpack (gzipped + minified) 21.73 KB (+0.07% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified) 50.22 KB (-0.09% 🔽)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 29.76 KB (-0.02% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 27.82 KB (-0.07% 🔽)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 49.44 KB (+0.02% 🔺)
@sentry/replay - Webpack (gzipped + minified) 43.12 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 69.2 KB (-0.03% 🔽)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 61.66 KB (+0.03% 🔺)

@AbhiPrasad AbhiPrasad changed the title ref(tracing): Add propagation getter to scope ref(tracing): Add necessary helpers for using propagation context on outgoing headers Jun 30, 2023
@AbhiPrasad AbhiPrasad merged commit 9006287 into develop Jul 1, 2023
@AbhiPrasad AbhiPrasad deleted the abhi-propagation-context-getter branch July 1, 2023 01:50
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.

3 participants