Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ Sentry.init({
});

Sentry.startSpan({ name: 'test span' }, () => {
Sentry.captureException(new Error('foo'));
Sentry.startSpan({ name: 'test inner span' }, () => {
Sentry.captureException(new Error('foo'));
});
});
5 changes: 3 additions & 2 deletions packages/opentelemetry/src/setupEventContextTrace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ export function setupEventContextTrace(client: Client): void {
...event.contexts,
};

const rootSpan = getRootSpan(span);

event.sdkProcessingMetadata = {
dynamicSamplingContext: getDynamicSamplingContextFromSpan(span),
dynamicSamplingContext: getDynamicSamplingContextFromSpan(rootSpan),
...event.sdkProcessingMetadata,
};

const rootSpan = getRootSpan(span);
const transactionName = spanHasName(rootSpan) ? rootSpan.name : undefined;
if (transactionName && !event.transaction) {
event.transaction = transactionName;
Expand Down