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

Function extractTraceID

cmd/tempo-vulture/validation.go:381–396  ·  view source on GitHub ↗
(trace *tempopb.Trace)

Source from the content-addressed store, hash-verified

379}
380
381func extractTraceID(trace *tempopb.Trace) string {
382 if len(trace.ResourceSpans) == 0 {
383 return ""
384 }
385
386 for _, resourceSpan := range trace.ResourceSpans {
387 for _, scopeSpan := range resourceSpan.ScopeSpans {
388 for _, span := range scopeSpan.Spans {
389 if len(span.TraceId) > 0 {
390 return fmt.Sprintf("%x", span.TraceId)
391 }
392 }
393 }
394 }
395 return ""
396}
397
398func (vs *ValidationService) logTraceAttributes(trace *tempopb.Trace, traceID string) {
399 vs.logger.Debug("=== TRACE ATTRIBUTES DEBUG ===", zap.String("traceID", traceID))

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected