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

Function printTrace

cmd/tempo-cli/cmd-query-trace-id.go:47–56  ·  view source on GitHub ↗
(trace *tempopb.Trace)

Source from the content-addressed store, hash-verified

45}
46
47func printTrace(trace *tempopb.Trace) error {
48 // tracebyid endpoints are protobuf, we are using 'gogo/protobuf/jsonpb' to marshal the
49 // trace to json because 'encoding/json' package can't handle +Inf, -Inf, NaN
50 marshaller := &jsonpb.Marshaler{}
51 err := marshaller.Marshal(os.Stdout, trace)
52 if err != nil {
53 _, _ = fmt.Fprintf(os.Stderr, "Failed to marshal trace: %v\n", err)
54 }
55 return nil
56}

Callers 1

RunMethod · 0.85

Calls 1

MarshalMethod · 0.65

Tested by

no test coverage detected