File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
1111import { addNonEnumerableProperty , dropUndefinedKeys } from '../utils-hoist/object' ;
1212import { hasTracingEnabled } from '../utils/hasTracingEnabled' ;
1313import { getRootSpan , spanIsSampled , spanToJSON } from '../utils/spanUtils' ;
14+ import { getCapturedScopesOnSpan } from './utils' ;
1415
1516/**
1617 * If you change this value, also update the terser plugin config to
@@ -116,7 +117,7 @@ export function getDynamicSamplingContextFromSpan(span: Span): Readonly<Partial<
116117 // So we end up with an active span that is not sampled (neither positively nor negatively)
117118 if ( hasTracingEnabled ( ) ) {
118119 dsc . sampled = String ( spanIsSampled ( rootSpan ) ) ;
119- // TODO(lforst): Grab scope off of root span and put sample_rand on dsc
120+ dsc . sample_rand = getCapturedScopesOnSpan ( rootSpan ) . scope ?. getPropagationContext ( ) . sampleRand . toString ( ) ;
120121 }
121122
122123 client . emit ( 'createDsc' , dsc , rootSpan ) ;
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ export function getInjectionData(context: Context): {
171171 dynamicSamplingContext,
172172 traceId : spanContext . traceId ,
173173 spanId : undefined ,
174- sampled : getSamplingDecision ( spanContext ) ,
174+ sampled : getSamplingDecision ( spanContext ) , // TODO: Do we need to change something here?
175175 } ;
176176 }
177177
@@ -184,7 +184,7 @@ export function getInjectionData(context: Context): {
184184 dynamicSamplingContext,
185185 traceId : spanContext . traceId ,
186186 spanId : spanContext . spanId ,
187- sampled : getSamplingDecision ( spanContext ) ,
187+ sampled : getSamplingDecision ( spanContext ) , // TODO: Do we need to change something here?
188188 } ;
189189 }
190190
You can’t perform that action at this time.
0 commit comments