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

Function parseTraceIDs

cmd/tempo-cli/cmd-redact.go:106–116  ·  view source on GitHub ↗

parseTraceIDs converts a slice of hex trace ID strings to raw byte slices.

(hexIDs []string)

Source from the content-addressed store, hash-verified

104
105// parseTraceIDs converts a slice of hex trace ID strings to raw byte slices.
106func parseTraceIDs(hexIDs []string) ([][]byte, error) {
107 traceIDs := make([][]byte, 0, len(hexIDs))
108 for _, id := range hexIDs {
109 b, err := util.HexStringToTraceID(id)
110 if err != nil {
111 return nil, fmt.Errorf("invalid trace ID %q: %w", id, err)
112 }
113 traceIDs = append(traceIDs, b)
114 }
115 return traceIDs, nil
116}
117
118// defaultSchedulerClientConfig returns a zero-value Config suitable for CLI use.
119func defaultSchedulerClientConfig() schedulerclient.Config {

Callers 2

TestParseTraceIDsFunction · 0.85
RunMethod · 0.85

Calls 1

HexStringToTraceIDFunction · 0.92

Tested by 1

TestParseTraceIDsFunction · 0.68