Retrieve the current trace in Go SDK #6113
-
I'm curious to know whether there is a way to retrieve, in the Go SDK, the current trace from the current context as a read-only copy, one that could (in theory) be serialized over the wire. I'm investigating an idea of adding a parameter to our API to return the OTEL trace alongside the API result, to aid in debugging upstream performance issues. Ideally, there would be a way at the beginning of the API handler to enforce that the trace is recorded if an incoming parameter is set to |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The trace.SpanFromContext method will give you the current span, it can be written. There is no way to retrieve the full trace. We don't keep the entire tree in memory. And with distribiuted tracing, that wouldn't be possible. |
Beta Was this translation helpful? Give feedback.
The trace.SpanFromContext method will give you the current span, it can be written.
There is no way to retrieve the full trace. We don't keep the entire tree in memory. And with distribiuted tracing, that wouldn't be possible.