Skip to content

Commit 342763c

Browse files
committed
use txn.attributes instead of txn.metadata.source
1 parent 3d5ba62 commit 342763c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/core/src/tracing/dynamicSamplingContext.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import type { Client, DynamicSamplingContext, Scope, Span, Transaction } from '@sentry/types';
1+
import type { Client, DynamicSamplingContext, Scope, Span, Transaction, TransactionSource } from '@sentry/types';
22
import { dropUndefinedKeys } from '@sentry/utils';
33

44
import { DEFAULT_ENVIRONMENT } from '../constants';
55
import { getClient, getCurrentScope } from '../exports';
6+
import { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../semanticAttributes';
67
import { spanIsSampled, spanToJSON } from '../utils/spanUtils';
78

89
/**
@@ -78,7 +79,7 @@ export function getDynamicSamplingContextFromSpan(span: Span): Readonly<Partial<
7879
}
7980

8081
// We don't want to have a transaction name in the DSC if the source is "url" because URLs might contain PII
81-
const source = txn.metadata.source;
82+
const source = txn.attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] as TransactionSource | undefined;
8283
const jsonSpan = spanToJSON(txn);
8384

8485
// after JSON conversion, txn.name becomes jsonSpan.description

0 commit comments

Comments
 (0)