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

Function EqualHexStringTraceIDs

pkg/util/traceid.go:119–130  ·  view source on GitHub ↗

EqualHexStringTraceIDs compares two trace ID strings and compares the resulting bytes after padding. Returns true unless there is a reason not to.

(a, b string)

Source from the content-addressed store, hash-verified

117// resulting bytes after padding. Returns true unless there is a reason not
118// to.
119func EqualHexStringTraceIDs(a, b string) (bool, error) {
120 aa, err := HexStringToTraceID(a)
121 if err != nil {
122 return false, err
123 }
124 bb, err := HexStringToTraceID(b)
125 if err != nil {
126 return false, err
127 }
128
129 return bytes.Equal(aa, bb), nil
130}
131
132func PadTraceIDTo16Bytes(traceID []byte) []byte {
133 if len(traceID) > 16 {

Callers 4

validateTraceSearchMethod · 0.92
traceInTracesFunction · 0.92

Calls 2

HexStringToTraceIDFunction · 0.85
EqualMethod · 0.45

Tested by 1