From 7bd62b72a361a34c7d383220e17f7a6b6c1e5431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerhard=20St=C3=B6bich?= <18708370+Flarna@users.noreply.github.com> Date: Fri, 6 Mar 2020 17:40:13 +0100 Subject: [PATCH] fix: change SpanContext.traceFlags to mandatory (#818) * fix: change SpanContext.traceFlags to mandatory According to spec SpanContext represents the W3C tracestate which includes traceId, spanId and traceFlags. As a side effect a new LinkContext types was added as links don't have traceFlags according to spec. * chore: review findings, rename TraceFlags.UNSAMPLED to NONE * fix: build * fix: tests * fix: correct merge Co-authored-by: Daniel Dyla --- src/JaegerHttpTraceFormat.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/JaegerHttpTraceFormat.ts b/src/JaegerHttpTraceFormat.ts index 45a85b7f0f0..aec84b7aa0f 100644 --- a/src/JaegerHttpTraceFormat.ts +++ b/src/JaegerHttpTraceFormat.ts @@ -58,9 +58,9 @@ export class JaegerHttpTraceFormat implements HttpTextFormat { const spanContext = getParentSpanContext(context); if (!spanContext) return; - const traceFlags = `0${( - spanContext.traceFlags || TraceFlags.UNSAMPLED - ).toString(16)}`; + const traceFlags = `0${(spanContext.traceFlags || TraceFlags.NONE).toString( + 16 + )}`; setter( carrier,