Skip to content

Commit 5bc9390

Browse files
committed
test changes
1 parent 820763a commit 5bc9390

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

internal/trace/context.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,21 +146,21 @@ func getTraceContext(ctx context.Context, headers map[string]string) (TraceConte
146146
parentID = val
147147
}
148148
}
149-
if parentID == "" {
150-
return tc, false
151-
}
152-
153149
samplingPriority := headers[samplingPriorityHeader]
154150
if samplingPriority == "" {
155151
if val, ok := ctx.Value(extension.DdSamplingPriority).(string); ok {
156152
samplingPriority = val
157153
}
158154
}
159-
if samplingPriority == "" {
160-
samplingPriority = "1" //sampler-keep
155+
// Remove this default to let tracer sampling rules take effect
156+
// if samplingPriority == "" {
157+
// samplingPriority = "1" //sampler-keep
158+
// }
159+
160+
// Only set sampling priority if it was explicitly provided
161+
if samplingPriority != "" {
162+
tc[samplingPriorityHeader] = samplingPriority
161163
}
162-
163-
tc[samplingPriorityHeader] = samplingPriority
164164
tc[traceIDHeader] = traceID
165165
tc[parentIDHeader] = parentID
166166

0 commit comments

Comments
 (0)