-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(v8): Remove metadata
on transaction
#11397
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
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 |
---|---|---|
|
@@ -25,7 +25,7 @@ import { | |
spanTimeInputToSeconds, | ||
spanToJSON, | ||
} from '../utils/spanUtils'; | ||
import { getDynamicSamplingContextFromSpan } from './dynamicSamplingContext'; | ||
import { freezeDscOnSpan, getDynamicSamplingContextFromSpan } from './dynamicSamplingContext'; | ||
import { logSpanStart } from './logSpans'; | ||
import { sampleSpan } from './sampling'; | ||
import { SentryNonRecordingSpan } from './sentryNonRecordingSpan'; | ||
|
@@ -245,12 +245,9 @@ function createChildSpanOrTransaction({ | |
parentSpanId, | ||
parentSampled: sampled, | ||
...spanContext, | ||
metadata: { | ||
dynamicSamplingContext: dsc, | ||
// eslint-disable-next-line deprecation/deprecation | ||
...spanContext.metadata, | ||
}, | ||
}); | ||
|
||
freezeDscOnSpan(span, dsc); | ||
} else { | ||
const { traceId, dsc, parentSpanId, sampled } = { | ||
...isolationScope.getPropagationContext(), | ||
|
@@ -262,23 +259,15 @@ function createChildSpanOrTransaction({ | |
parentSpanId, | ||
parentSampled: sampled, | ||
...spanContext, | ||
metadata: { | ||
dynamicSamplingContext: dsc, | ||
// eslint-disable-next-line deprecation/deprecation | ||
...spanContext.metadata, | ||
}, | ||
}); | ||
|
||
if (dsc) { | ||
freezeDscOnSpan(span, dsc); | ||
} | ||
Comment on lines
+264
to
+266
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. Just to check here but I think this is already how it works: Freezing only happens where we're continuing a trace (i.e. if a propagationContext with a DSC exists). In case it doesn't (i.e. we're head of trace || no DSC on propCtx), we don't freeze the DSC at all at the moment, correct? Meaning, we'd populate it for outgoing requests headers or when the span/txn is is processed. 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. yes, |
||
} | ||
|
||
logSpanStart(span); | ||
|
||
// TODO v8: Technically `startTransaction` can return undefined, which is not reflected by the types | ||
// This happens if tracing extensions have not been added | ||
// In this case, we just want to return a non-recording span | ||
if (!span) { | ||
return new SentryNonRecordingSpan(); | ||
} | ||
|
||
setCapturedScopesOnSpan(span, scope, isolationScope); | ||
|
||
return span; | ||
|
Uh oh!
There was an error while loading. Please reload this page.