(trace *tempopb.Trace)
| 45 | } |
| 46 | |
| 47 | func 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 | } |