Skip to content

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

Merged
AbhiPrasad merged 3 commits into
masterfrom
abhi-otel-propagator-extract
Nov 3, 2022
Merged

feat(otel): Add extract functionality to SentryPropagator#6115
AbhiPrasad merged 3 commits into
masterfrom
abhi-otel-propagator-extract

Conversation

@AbhiPrasad

Copy link
Copy Markdown
Contributor

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

@AbhiPrasadAbhiPrasad mentioned this pull request Nov 2, 2022
5 tasks
@AbhiPrasad
AbhiPrasadforce-pushed the abhi-otel-propagator-extract branch from becc6cb to 961e016CompareNovember 2, 2022 13:29
@AbhiPrasadAbhiPrasad added this to the OpenTelemetry Support milestone Nov 2, 2022
@AbhiPrasadAbhiPrasad self-assigned this Nov 2, 2022
@github-actions

github-actionsBot commented Nov 2, 2022

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
@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
AbhiPrasadforce-pushed the abhi-otel-propagator-extract branch from 961e016 to e745253CompareNovember 2, 2022 13:56
Base automatically changed from abhi-otel-propagator-inject to masterNovember 2, 2022 15:27
@AbhiPrasad
AbhiPrasadforce-pushed the abhi-otel-propagator-extract branch from e745253 to 78e6c51CompareNovember 2, 2022 15:34
@AbhiPrasad
AbhiPrasad requested a review from mydeaNovember 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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
AbhiPrasadforce-pushed the abhi-otel-propagator-extract branch from 78e6c51 to d884c91CompareNovember 3, 2022 12:19
@AbhiPrasad
AbhiPrasad enabled auto-merge (squash) November 3, 2022 12:19
@AbhiPrasad
AbhiPrasad merged commit a430af3 into masterNov 3, 2022
@AbhiPrasad
AbhiPrasad deleted the abhi-otel-propagator-extract branch November 3, 2022 13:09
Sign up for freeto 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

@AbhiPrasad@mydea