Skip to content

Commit

Permalink
fix: remove padding logic for jaeger propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
sysulq committed Jan 20, 2025
1 parent 7c3335f commit 3a9e02f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pkg/core/xtrace/propagation.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (
traceID128bitsWidth = 128 / 4
spanIDWidth = 64 / 4

idPaddingChar = "0"
// idPaddingChar = "0"

flagsDebug = 0x02
flagsSampled = 0x01
Expand Down Expand Up @@ -96,11 +96,11 @@ func extract(ctx context.Context, headerVal string) (context.Context, trace.Span
if len(id) > traceID128bitsWidth {
return ctx, empty, errInvalidTraceIDLength
}
// padding when length is less than 32
if len(id) < traceID128bitsWidth {
padCharCount := traceID128bitsWidth - len(id)
id = strings.Repeat(idPaddingChar, padCharCount) + id
}
// // padding when length is less than 32
// if len(id) < traceID128bitsWidth {
// padCharCount := traceID128bitsWidth - len(id)
// id = strings.Repeat(idPaddingChar, padCharCount) + id
// }
scc.TraceID, err = trace.TraceIDFromHex(id)
if err != nil {
return ctx, empty, errMalformedTraceID
Expand All @@ -113,11 +113,11 @@ func extract(ctx context.Context, headerVal string) (context.Context, trace.Span
if len(id) > spanIDWidth {
return ctx, empty, errInvalidSpanIDLength
}
// padding when length is less than 16
if len(id) < spanIDWidth {
padCharCount := spanIDWidth - len(id)
id = strings.Repeat(idPaddingChar, padCharCount) + id
}
// // padding when length is less than 16
// if len(id) < spanIDWidth {
// padCharCount := spanIDWidth - len(id)
// id = strings.Repeat(idPaddingChar, padCharCount) + id
// }
scc.SpanID, err = trace.SpanIDFromHex(id)
if err != nil {
return ctx, empty, errMalformedSpanID
Expand Down

0 comments on commit 3a9e02f

Please sign in to comment.