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

Graph the number of requests to a service according to response time

AlexLarrieu
Participant

Hello,

Using DQL, I want to create a graph to display the number of requests for a specific service with a response time > 10s.

Similar to the Distributed Tracing app ( but not only Successful requests ).

Could you help me?
Alex

AlexLarrieu_0-1779353005023.png

 

3 REPLIES 3

krzysztof_hoja
Dynatrace Champion
Dynatrace Champion

If you are interested how query looks like, you can refer to query id shown in the app:

krzysztof_hoja_0-1780914481583.png

and then check dt.system.query_exections table for particular query id with:

fetch dt.system.query_executions
| filter query_id == "0b12de7e-2891-4acc-a335-1ae959a054c4"

Kenny_Gillette
Dynatrace Leader
Dynatrace Leader

Hi,

This is possible.  Set filter you want to use in Distributed Trace.  Click 3 dots on right and click on "Edit in Notebook" or "Pin to Dashboard"

Kenny_Gillette_0-1780921766863.png

Once there, click on Options then Line

Kenny_Gillette_1-1780921958214.png

 

Click Run

Kenny_Gillette_0-1780924010272.png

 

 

Dynatrace Assist:

Here's a DQL query to display the number of requests per time interval for a specific service where response time > 10s, as a timeseries graph — covering all requests (not just successful ones):


DQL Query — Requests with Response Time > 10s (Timeseries)
fetch spans, from: now() - 2h
| filter request.is_root_span == true
| filter duration > 10s
| filter dt.entity.service == "SERVICE-XXXXXXXXXXXXXXXX"
| makeTimeseries requests = count(), interval: 1m
 

🔁 Replace SERVICE-XXXXXXXXXXXXXXXX with your actual service entity ID.


How to Use This in Distributed Tracing
  1. Open the Distributed Tracing app
  2. Click "Run DQL" or open a Notebook / Dashboard tile
  3. Paste the query above
  4. Set the visualization to Bar chart or Line chart

Key Points
Element Explanation
request.is_root_span == trueCounts only entry-point requests (like the Distributed Tracing app does), not internal/child spans
duration > 10sFilters spans with response time exceeding 10 seconds (10s is a valid DQL duration literal)
No request.is_failed filterIncludes both successful and failed requests
makeTimeseries ... count()Produces a time-bucketed series suitable for a graph
interval: 1mAdjust granularity — use 5m, 10m, etc. for longer timeframes

Optional: Filter by Service Name Instead of ID

If you prefer to filter by name rather than entity ID:

fetch spans, from: now() - 2h
| filter request.is_root_span == true
| filter duration > 10s
| fieldsAdd service_name = entityName(dt.entity.service)
| filter service_name == "your-service-name"
| makeTimeseries requests = count(), interval: 1m
 

Optional: Break Down by Service (All Services)

To see all services with slow requests in one graph:

fetch spans, from: now() - 2h
| filter request.is_root_span == true
| filter duration > 10s
| fieldsAdd service_name = entityName(dt.entity.service)
| makeTimeseries requests = count(), interval: 1m, by: { service_name }
 
 
 

 

 

Dynatrace Certified Professional

krzysztof_hoja
Dynatrace Champion
Dynatrace Champion

It is also possible to do the same for top chart. I was not able initially to find "three dots" for top chart. When you hover the chart menu open in upper right corner and you can get it directly as in app

 

krzysztof_hoja_1-1780945370206.png

 

Featured Posts