2

Is there a way to get the full trace request given a starting point from anywhere in the lifecycle of the trace?

Basically, if I have a middle point or an end point of a trace, can I use those points to obtain the full trace of a request?

I want to build a tracing service (in Golang) where the service can return the full trace of a request given that a user supplies a point/span at any time during the trace of the request.

I have tried searching and looking to see if any projects have mentioned backwards tracing or something similar to that.

Currently, with other tracers like Datadog, its not possible to get the trace of a full request given any starting point that is not the beginning.

2 Answers2

1

In OpenTelemetry, the Trace ID is immutable and intended to be the same for the entire logical request (assuming W3C Headers). A trace is a directed acyclic graph, which means the ordering can be determined by finding all spans with the same trace ID and then sorting them by their edges (which would be determined by the span ID and parent span ID fields). This means that you can 'look back' very easily as long as you have all of the spans available - you just look for everything with the same trace ID as the span you have, and create the graph.

Austin Parker
  • 323
  • 2
  • 6
0

It depends on what you've logged. If you have access to the full raw logs, and you've logged the entire context at the beginning of every server, client, and middleware request, you can perhaps look for all the logs with a similar traceID in their context. Again, based on your instrumentation, you might not HAVE this log.

Shay Nehmad
  • 1,103
  • 1
  • 12
  • 25