We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f82ff4 commit e379e59Copy full SHA for e379e59
packages/opentelemetry-tracing/src/Tracer.ts
@@ -16,8 +16,8 @@
16
17
import * as api from '@opentelemetry/api';
18
import {
19
- InstrumentationLibrary,
20
IdGenerator,
+ InstrumentationLibrary,
21
RandomIdGenerator,
22
sanitizeAttributes,
23
} from '@opentelemetry/core';
@@ -87,7 +87,9 @@ export class Tracer implements api.Tracer {
87
const attributes = sanitizeAttributes(options.attributes);
88
// make sampling decision
89
const samplingResult = this._sampler.shouldSample(
90
- context,
+ options.root
91
+ ? api.setSpanContext(context, api.INVALID_SPAN_CONTEXT)
92
+ : context,
93
traceId,
94
name,
95
spanKind,
0 commit comments