cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Collecting all sub-traces for a Trace ID via API

Jan_Lerche
Visitor

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?

Trace_ID.png

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.

1 REPLY 1

Julius_Loman
DynaMight Legend
DynaMight Legend

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.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner