Skip to content

Commit

Permalink
fix: change SpanContext.traceFlags to mandatory (open-telemetry#818)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
Flarna and dyladan authored Mar 6, 2020
1 parent 09f881c commit 7bd62b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/JaegerHttpTraceFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7bd62b7

Please sign in to comment.