10 Jan 2025 01:02 PM
Hello,
I need a DQL to answer the following questions:
- What is the response time, failure count and throughput of Service B that is called by Service A. The result need to be only for the calls that Service A make to Service B.
I created a DQL that show the services dependency. But could not get the metrics I need.
fetch dt.entity.service
| expand calledby_service=called_by[dt.entity.service]
| expand calls_service=calls[dt.entity.service]
| fieldsAdd service_type = serviceType, clusteredBy = clustered_by[dt.entity.kubernetes_cluster][0], belongsToNamespace = belongs_to[dt.entity.cloud_application_namespace][0], belongsToApp = belongs_to[dt.entity.cloud_application][0],instantiates= instantiates[dt.entity.service_instance][0]
| lookup [fetch dt.entity.service], sourceField:calledby_service, lookupField:id, fields:{Incoming=entity.name}
| lookup [fetch dt.entity.service], sourceField:calls_service, lookupField:id, fields:{Outgoing=entity.name}
| lookup [fetch dt.entity.kubernetes_cluster], sourceField:clusteredBy, lookupField:id, fields:{Cluster = entity.name}
| lookup [fetch dt.entity.cloud_application_namespace], sourceField:belongsToNamespace, lookupField:id, fields:{Namespace = entity.name}
| fields service_type, service=entity.name, Incoming ,Outgoing, Namespace, Cluster
| summarize count(), by:{service,Incoming,Outgoing}
10 Jan 2025 03:38 PM
Unfortunately there is no such metric as far as I know. You can find the relations as you did but can't filter out a certain service metric based on called/caller service.
10 Jan 2025 04:01 PM
Agree you cannot do this in the current state. Although we have a preview of Traces on Grail, in which you'd be able to query the traces/spans that are calling Service B from Service A and can calculate your metrics based on that. We can't wait for Traces on Grail to be fully released!
10 Jan 2025 09:25 PM
We do have access to Traces on Grail in our QA environment. I'm trying a query to get those data but no success yet.
13 Jan 2025 10:26 AM
I also tried on playground but couldn't find a solution yet.
13 Jan 2025 01:08 PM
You may check this thread with some hints and query examples:
https://community.dynatrace.com/t5/DQL/DQL-on-spans-variant-for-called-by-analysis/m-p/248551/highli...