Skip to content

feat(otel): Add extract functionality to SentryPropagator #6115

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
Nov 3, 2022

Conversation

AbhiPrasad
Copy link
Member

ref #6107

blocked by #6107

Extract sentry-trace and baggage headers from incoming requests and add them to context. sentry-trace traceparent info is added to span context, while a new context field is added for dynamic sampling context.

Approach is based on https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-propagator-b3/src/B3SinglePropagator.ts

@AbhiPrasad AbhiPrasad mentioned this pull request Nov 2, 2022
5 tasks
@AbhiPrasad AbhiPrasad force-pushed the abhi-otel-propagator-extract branch from becc6cb to 961e016 Compare November 2, 2022 13:29
@AbhiPrasad AbhiPrasad added this to the OpenTelemetry Support milestone Nov 2, 2022
@AbhiPrasad AbhiPrasad self-assigned this Nov 2, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2022

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.5 KB (+0.02% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 60.35 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.13 KB (+0.02% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 53.68 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 19.87 KB (0%)
@sentry/browser - Webpack (minified) 65.09 KB (0%)
@sentry/react - Webpack (gzipped + minified) 19.89 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 45.79 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.25 KB (+0.01% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 24.63 KB (+0.01% 🔺)

@AbhiPrasad AbhiPrasad force-pushed the abhi-otel-propagator-extract branch from 961e016 to e745253 Compare November 2, 2022 13:56
Base automatically changed from abhi-otel-propagator-inject to master November 2, 2022 15:27
@AbhiPrasad AbhiPrasad force-pushed the abhi-otel-propagator-extract branch from e745253 to 78e6c51 Compare November 2, 2022 15:34
@AbhiPrasad AbhiPrasad requested a review from mydea November 3, 2022 10:42
public extract(context: Context, _carrier: unknown, _getter: TextMapGetter): Context {
return context;
public extract(context: Context, carrier: unknown, getter: TextMapGetter): Context {
let newContext = context;
Copy link
Member

Choose a reason for hiding this comment

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

l: Do we need newContext here, or can we just set directly on context?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was done because I didn't want to mutate the func param as per https://eslint.org/docs/latest/rules/no-param-reassign

@AbhiPrasad AbhiPrasad force-pushed the abhi-otel-propagator-extract branch from 78e6c51 to d884c91 Compare November 3, 2022 12:19
@AbhiPrasad AbhiPrasad enabled auto-merge (squash) November 3, 2022 12:19
@AbhiPrasad AbhiPrasad merged commit a430af3 into master Nov 3, 2022
@AbhiPrasad AbhiPrasad deleted the abhi-otel-propagator-extract branch November 3, 2022 13:09
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.

2 participants