Skip to content

Commit 0be630a

Browse files
committed
chore: sampler gets a full context (open-telemetry#1631)
1 parent 6588aac commit 0be630a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

api/src/trace/Sampler.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { SpanContext } from './span_context';
18-
import { SpanKind } from './span_kind';
17+
import { Context } from '@opentelemetry/context-base';
1918
import { Attributes } from './attributes';
2019
import { Link } from './link';
2120
import { SamplingResult } from './SamplingResult';
21+
import { SpanKind } from './span_kind';
2222

2323
/**
2424
* This interface represent a sampler. Sampling is a mechanism to control the
@@ -29,8 +29,7 @@ export interface Sampler {
2929
/**
3030
* Checks whether span needs to be created and tracked.
3131
*
32-
* @param parentContext Parent span context. Typically taken from the wire.
33-
* Can be null.
32+
* @param context Parent Context which may contain a span.
3433
* @param traceId of the span to be created. It can be different from the
3534
* traceId in the {@link SpanContext}. Typically in situations when the
3635
* span to be created starts a new trace.
@@ -42,7 +41,7 @@ export interface Sampler {
4241
* @returns a {@link SamplingResult}.
4342
*/
4443
shouldSample(
45-
parentContext: SpanContext | undefined,
44+
context: Context,
4645
traceId: string,
4746
spanName: string,
4847
spanKind: SpanKind,

0 commit comments

Comments
 (0)