diff --git a/packages/dd-trace/src/opentracing/propagation/text_map.js b/packages/dd-trace/src/opentracing/propagation/text_map.js index 346e5e00911..1346f85de72 100644 --- a/packages/dd-trace/src/opentracing/propagation/text_map.js +++ b/packages/dd-trace/src/opentracing/propagation/text_map.js @@ -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) { @@ -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 } diff --git a/packages/dd-trace/test/opentracing/propagation/text_map.spec.js b/packages/dd-trace/test/opentracing/propagation/text_map.spec.js index e6a206a8bbd..58ee69047ba 100644 --- a/packages/dd-trace/test/opentracing/propagation/text_map.spec.js +++ b/packages/dd-trace/test/opentracing/propagation/text_map.spec.js @@ -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', () => {