You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-07-03 00:27:03 +02:00
Use a constant padding for 64-bit B3 trace IDs (#701)
This commit is contained in:
committed by
GitHub
parent
2df5f81356
commit
a547cc3bfe
@ -29,6 +29,7 @@ const (
|
|||||||
B3SpanIDHeader = "X-B3-SpanId"
|
B3SpanIDHeader = "X-B3-SpanId"
|
||||||
B3SampledHeader = "X-B3-Sampled"
|
B3SampledHeader = "X-B3-Sampled"
|
||||||
B3ParentSpanIDHeader = "X-B3-ParentSpanId"
|
B3ParentSpanIDHeader = "X-B3-ParentSpanId"
|
||||||
|
b3TraceIDPadding = "0000000000000000"
|
||||||
)
|
)
|
||||||
|
|
||||||
// B3 propagator serializes SpanContext to/from B3 Headers.
|
// B3 propagator serializes SpanContext to/from B3 Headers.
|
||||||
@ -89,7 +90,7 @@ func (b3 B3) Extract(ctx context.Context, supplier propagation.HTTPSupplier) con
|
|||||||
|
|
||||||
func fixB3TID(in string) string {
|
func fixB3TID(in string) string {
|
||||||
if len(in) == 16 {
|
if len(in) == 16 {
|
||||||
in = strings.Repeat("0", 16) + in
|
in = b3TraceIDPadding + in
|
||||||
}
|
}
|
||||||
return in
|
return in
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user