16 Jun 2025 05:57 PM
Hi,
I work as a developer for a enterprise-level organization on the SRE team. My team builds a large/mature internal web application that our company developments teams use to track required resiliency tasks such as implement connection pooling, circuit breakers, caching etc.
We use the Dynatrace API to construct entity relationships between our microservices but right now we only have it mapped at a single level. The relationships we are trying to get to is displayed in Dynatrace through Service Flow and SmartScape. However since these two capabilities are not accessible via API (I think?) our desired state is not easily obtainable.
Using the entities API we know the direct upstream and downstream entity relationships which we use to correlate dependencies for our application. I need help understanding how we can determine these relationships at multiple levels using the Dynatrace API.
Right now all I can think of is querying spans through grail and use the trace/span ids to correlate entities. But this can be an expensive and complex ETL process and I thought it would be good to ask this question in this forum
Here is an example with services A, B, and Database C:
Scenario: A (Root Calling Service ) -> B (Downstream Calling Service) -> C (Database)
Our Current Relationships: A (Root Calling Service) - > B (Downstream Calling Service) and B (Downstream Calling Service) -> C (Database)
Need to implement: A (Service) -> C (Database)
Current Understand using Entities API: This only tells me the direct relationships for a specific entity. It does not tell me that Service A calls Service C indirectly through a downstream service
Service A
Service B
Database/Host C
Final Question:
How can I programmatically find the relationship from DynatraceMetricsController (Root Calling Service A) to the indirect entity (C)
12 Dec 2025 01:50 PM
Hello, Community!
Do you know how to help Nick with finding a solution to the challenge he described above?
Any help is highly appreciated, thank you!
14 Dec 2025 08:33 PM
@Nick-Montana I'd recommend having a look at the upcoming smartscape in Grail where you can traverse relationships. Especially at the traverse command. See that in action in playground. But keep in mind, the relations might be a little bit different than you can see in the Gen2 (service flow) especially when it comes to third party services or databases.
If you are not in SaaS and you run Dynatrace Managed, then you need to use the Entities API as you already do. There is no way to traverse relations and you need to issue multiple calls.
Both of it is service to service relation. This does not allow you to see relations for particular request (e.g. show me the service flow this this request only). This is available in Grail with querying spans directly (no other method is currently possible). For Managed (Gen2), it's only UI based service flow / backtrace, which also does it from traces.
Featured Posts