MCPcopy
hub / github.com/grafana/tempo / PadTraceIDTo16Bytes

Function PadTraceIDTo16Bytes

pkg/util/traceid.go:132–145  ·  view source on GitHub ↗
(traceID []byte)

Source from the content-addressed store, hash-verified

130}
131
132func PadTraceIDTo16Bytes(traceID []byte) []byte {
133 if len(traceID) > 16 {
134 return traceID[len(traceID)-16:]
135 }
136
137 if len(traceID) == 16 {
138 return traceID
139 }
140
141 padded := make([]byte, 16)
142 copy(padded[16-len(traceID):], traceID)
143
144 return padded
145}
146
147func hexStringToID(id string, isSpan bool) ([]byte, error) {
148 // The encoding/hex package does not handle non-hex characters.

Callers 4

traceToParquetFunction · 0.92
TestPadTraceIDTo16BytesFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestPadTraceIDTo16BytesFunction · 0.68