Skip to content
This repository was archived by the owner on Aug 17, 2020. It is now read-only.

Commit 6bd7d60

Browse files
committed
BigEndian encoding
1 parent b16172f commit 6bd7d60

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tracer/propagation_ot.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ func (p *binaryPropagator) Inject(
176176

177177
state := wire.TracerState{}
178178
bytes, _ := sc.TraceID.MarshalBinary()
179-
state.TraceIdHi = binary.LittleEndian.Uint64(bytes[:8])
180-
state.TraceIdLo = binary.LittleEndian.Uint64(bytes[8:])
179+
state.TraceIdHi = binary.BigEndian.Uint64(bytes[:8])
180+
state.TraceIdLo = binary.BigEndian.Uint64(bytes[8:])
181181
state.SpanId = sc.SpanID
182182
state.Sampled = sc.Sampled
183183
state.BaggageItems = sc.Baggage
@@ -227,8 +227,8 @@ func (p *binaryPropagator) Extract(
227227
}
228228

229229
traceIdBytes := make([]byte, 16)
230-
binary.LittleEndian.PutUint64(traceIdBytes[:8], ctx.TraceIdHi)
231-
binary.LittleEndian.PutUint64(traceIdBytes[8:], ctx.TraceIdLo)
230+
binary.BigEndian.PutUint64(traceIdBytes[:8], ctx.TraceIdHi)
231+
binary.BigEndian.PutUint64(traceIdBytes[8:], ctx.TraceIdLo)
232232
traceID, _ := uuid.FromBytes(traceIdBytes)
233233
return SpanContext{
234234
TraceID: traceID,

0 commit comments

Comments
 (0)