From 1036e53fb6057a3a52df69b5bafd5124ea671345 Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Fri, 30 Oct 2020 11:28:25 -0400 Subject: [PATCH] chore: sampler gets a full context (#1631) --- api/src/trace/Sampler.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/api/src/trace/Sampler.ts b/api/src/trace/Sampler.ts index 0d23f51e093..b4f5dcc6308 100644 --- a/api/src/trace/Sampler.ts +++ b/api/src/trace/Sampler.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import { SpanContext } from './span_context'; -import { SpanKind } from './span_kind'; +import { Context } from '@opentelemetry/context-base'; import { Attributes } from './attributes'; import { Link } from './link'; import { SamplingResult } from './SamplingResult'; +import { SpanKind } from './span_kind'; /** * This interface represent a sampler. Sampling is a mechanism to control the @@ -29,8 +29,7 @@ export interface Sampler { /** * Checks whether span needs to be created and tracked. * - * @param parentContext Parent span context. Typically taken from the wire. - * Can be null. + * @param context Parent Context which may contain a span. * @param traceId of the span to be created. It can be different from the * traceId in the {@link SpanContext}. Typically in situations when the * span to be created starts a new trace. @@ -42,7 +41,7 @@ export interface Sampler { * @returns a {@link SamplingResult}. */ shouldSample( - parentContext: SpanContext | undefined, + context: Context, traceId: string, spanName: string, spanKind: SpanKind,