Skip to content

Commit

Permalink
chore(w3c): avoid setting _dd.parent_id to 16 zeros
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur committed Aug 6, 2024
1 parent ed9b0b3 commit 272cbd5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions packages/dd-trace/src/opentracing/propagation/text_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,7 @@ class TextMapPropagator {
}

_hasParentIdInTags (spanContext) {
return tags.DD_PARENT_ID in spanContext._trace.tags &&
spanContext._trace.tags[tags.DD_PARENT_ID] !== zeroTraceId
return tags.DD_PARENT_ID in spanContext._trace.tags
}

_updateParentIdFromDdHeaders (carrier, firstSpanContext) {
Expand Down Expand Up @@ -445,10 +444,6 @@ class TextMapPropagator {
}
})

if (!spanContext._trace.tags[tags.DD_PARENT_ID]) {
spanContext._trace.tags[tags.DD_PARENT_ID] = zeroTraceId
}

this._extractBaggageItems(carrier, spanContext)
return spanContext
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ describe('TextMapPropagator', () => {

const carrier = textMap
const spanContext = propagator.extract(carrier)
expect(spanContext._trace.tags).to.have.property('_dd.parent_id', '0000000000000000')
expect(spanContext._trace.tags).to.not.have.property('_dd.parent_id')
})

it('should not extract tracestate from tracecontext when trace IDs don\'t match', () => {
Expand Down

0 comments on commit 272cbd5

Please sign in to comment.