DQL
Questions about Dynatrace Query Language
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Graph showing the response time of outgoing services

albertokirey
Participant

Hello everyone,
I'd like to create a graph showing the response times of calls to other services that my Mulesoft service makes (and maybe also the failure rate). It's similar to what's already available in the Services dashboard under "Outgoing services," but all in a single graph. How can I do this?

Thanks

3 REPLIES 3

t_pawlak
Leader

The easiest way is to query the built-in service metrics rather than spans. The Outgoing services tile in the Service app is based on service-to-service request metrics, and you can recreate a similar visualization in a dashboard.

For example:

timeseries {
    response_time = avg(dt.service.request.response_time)
},
by: { dt.entity.service, dt.entity.service_to }
| filter dt.entity.service == "SERVICE-9C186B48B0905E85"

 

If you want the 90th percentile instead:

timeseries {
    responseTime_p90_timeseries = percentile(dt.service.request.response_time, 90)
},
by: { dt.entity.service, dt.entity.service_to }
| filter dt.entity.service == "SERVICE-9C186B48B0905E85"

To visualize the failure rate of outgoing calls:

timeseries {
    failure_rate = avg(dt.service.request.failure_rate)
},
by: { dt.entity.service, dt.entity.service_to }
| filter dt.entity.service == "SERVICE-9C186B48B0905E85"

Each downstream service will appear as a separate series on the same graph, allowing you to compare response times or failure rates over time.

or in one graph do this:

// p50
timeseries responseTime_p50_timeseries = percentile(dt.service.request.response_time, 50),
    filter: (dt.entity.service == "SERVICE-9C186B48B0905E85"), 
    nonempty: true  
| fieldsAdd metricName = "Response time p50"
| append[
// p90
timeseries responseTime_p90_timeseries = percentile(dt.service.request.response_time, 90),
    filter: (dt.entity.service == "SERVICE-9C186B48B0905E85" OR dt.smartscape.service == toSmartscapeId("SERVICE-9C186B48B0905E85")), nonempty: true  | fieldsAdd metricName = "Response time p90"]
| append[
// p99
timeseries responseTime_p99_timeseries = percentile(dt.service.request.response_time, 99),
    filter: (dt.entity.service == "SERVICE-9C186B48B0905E85" 
    OR dt.smartscape.service == toSmartscapeId("SERVICE-9C186B48B0905E85")), nonempty: true  
    | fieldsAdd metricName = "Response time p99"]

Hi @t_pawlak ,
it seems not to be working. The dt.entity.service_to doesn't exist.

albertokirey_0-1782994262877.png

This is the DQL:

timeseries { response_time = avg(dt.service.request.response_time) }, by: { dt.entity.service, dt.entity.service_to }
| filter in(dt.entity.service, classicEntitySelector("""type(service), entityname.equals("Mulesoft Service Prod")"""))

 

albertokirey
Participant

Maybe I should use this DQL?

timeseries { response_time = avg(dt.service.request.response_time) }, by: { dt.entity.service }
| filter in(dt.entity.service, classicEntitySelector("""  type(SERVICE), toRelationship.calls(entityId("SERVICE-7B67187994EC59EC")) """))
| fieldsAdd service_name = entityName(dt.entity.service)

 
Is there anyone who could confirm this?

Thanks

Featured Posts