We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a12f92 commit 89b7166Copy full SHA for 89b7166
Trace/SpanBuilder.php
@@ -155,10 +155,15 @@ public function startSpan(): API\SpanInterface
155
$samplingDecision = $samplingResult->getDecision();
156
$samplingResultTraceState = $samplingResult->getTraceState();
157
158
+ $flags = $parentSpanContext->getTraceFlags() & 0x2;
159
+ if ($samplingDecision === SamplingResult::RECORD_AND_SAMPLE) {
160
+ $flags |= API\TraceFlags::SAMPLED;
161
+ }
162
+
163
$spanContext = API\SpanContext::create(
164
$traceId,
165
$spanId,
- SamplingResult::RECORD_AND_SAMPLE === $samplingDecision ? API\TraceFlags::SAMPLED : API\TraceFlags::DEFAULT,
166
+ $flags,
167
$samplingResultTraceState,
168
);
169
0 commit comments