-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
ref(opentelemetry): Remove enhanceDscWithOpenTelemetryRootSpanName #22797
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
Changes from all commits
34060d3
424bb0b
2f71780
a4d5cd9
482e873
411dfb3
0fd9843
3af9587
5b88115
0d1637d
baf73c5
1b24c88
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,5 @@ | ||
| export { getScopesFromContext } from './utils/contextData'; | ||
|
|
||
| export { enhanceDscWithOpenTelemetryRootSpanName } from './utils/enhanceDscWithOpenTelemetryRootSpanName'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Public API removed without migration docsMedium Severity
Additional Locations (2)Triggered by project rule: PR Review Guidelines for Cursor Bot Reviewed by Cursor Bugbot for commit baf73c5. Configure here. |
||
|
|
||
| export { getTraceContextForScope } from './trace'; | ||
|
|
||
| export { setupEventContextTrace } from './setupEventContextTrace'; | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import type { DynamicSamplingContext } from '@sentry/core'; | ||
|
|
||
| /** | ||
| * Reconcile a freshly-derived DSC's `sampled` flag with the OTel sampling decision. | ||
| * | ||
| * Only applies to a DSC that core generated from the span's (binary) trace flags — never to a frozen | ||
| * incoming DSC from the trace state, which the caller leaves untouched per the propagation spec. | ||
| * Trace flags cannot tell a *deferred* decision (an incoming remote span whose decision lives in the | ||
| * trace state) apart from a definitive *unsampled* one — both read as `traceFlags: NONE`. | ||
| * `getSamplingDecision` resolves this via the OTel trace state, so we let it win here: drop `sampled` | ||
| * when the decision is deferred (`undefined`), and — matching the OTel SDK, whose unsampled spans are | ||
| * nameless non-recording spans — drop the transaction name when the trace is definitively unsampled. | ||
| */ | ||
| export function reconcileDscSampled( | ||
| dsc: Partial<DynamicSamplingContext>, | ||
| sampled: boolean | undefined, | ||
| ): Partial<DynamicSamplingContext> { | ||
| const reconciled = { ...dsc }; | ||
|
|
||
| if (sampled === undefined) { | ||
| delete reconciled.sampled; | ||
| } else { | ||
| reconciled.sampled = String(sampled); | ||
| if (sampled === false) { | ||
| delete reconciled.transaction; | ||
| } | ||
| } | ||
|
|
||
| return reconciled; | ||
| } |


Uh oh!
There was an error while loading. Please reload this page.