14 Apr 202312:56 PM - last edited on 17 Apr 202309:57 AM by MaciejNeumann
Hello Dynatrace community
I'm looking for a solution for the following problem. It consists of two parts.
1st: How can I get the Trace ID of a record that I can identify via Dynatrace API?
2nd: If it is possible to get this information via API, how can I get all Span IDs (or other attributes) of the spans that are sharing the same Trace ID?
Background: If several calls are content of a single distributed trace, all of them create an own span but share one trace ID. Further there is a relationship between called service and caller, that is mentioned as Parent span ID in the Dynatrace UI. The initial span doesn't have a parent. If want to collect this data via API like the UI does, I need these relationships.
Collected distributed trace data is not exposed via API, so the answer is - you cannot. At least not for a single Trace or list of traces. The closest approach I can think of would be using just the monitored entities API and using the relationsips between entities and use filters where possible, but you get just the "service flow" data - relations ships between services and not individual requests.