@@ -15,9 +15,8 @@ import {
1515 baggageHeaderToDynamicSamplingContext ,
1616 dynamicSamplingContextToSentryBaggageHeader ,
1717} from '../utils-hoist/baggage' ;
18- import { extractOrgIdFromDsnHost } from '../utils-hoist/dsn' ;
1918import { addNonEnumerableProperty } from '../utils-hoist/object' ;
20- import { getCapturedScopesOnSpan } from './utils' ;
19+ import { deriveOrgIdFromClient , getCapturedScopesOnSpan } from './utils' ;
2120
2221/**
2322 * If you change this value, also update the terser plugin config to
@@ -45,14 +44,7 @@ export function freezeDscOnSpan(span: Span, dsc: Partial<DynamicSamplingContext>
4544export function getDynamicSamplingContextFromClient ( trace_id : string , client : Client ) : DynamicSamplingContext {
4645 const options = client . getOptions ( ) ;
4746
48- const { publicKey : public_key , host } = client . getDsn ( ) || { } ;
49-
50- let org_id : string | undefined ;
51- if ( options . orgId ) {
52- org_id = String ( options . orgId ) ;
53- } else if ( host ) {
54- org_id = extractOrgIdFromDsnHost ( host ) ;
55- }
47+ const { publicKey : public_key } = client . getDsn ( ) || { } ;
5648
5749 // Instead of conditionally adding non-undefined values, we add them and then remove them if needed
5850 // otherwise, the order of baggage entries changes, which "breaks" a bunch of tests etc.
@@ -61,7 +53,7 @@ export function getDynamicSamplingContextFromClient(trace_id: string, client: Cl
6153 release : options . release ,
6254 public_key,
6355 trace_id,
64- org_id,
56+ org_id : deriveOrgIdFromClient ( client ) ,
6557 } ;
6658
6759 client . emit ( 'createDsc' , dsc ) ;
0 commit comments