25 Sep 2024 07:27 AM
Please tell me how to output the total "reqcount" value in the following DQL.
timeseries reqcount=sum(dt.service.request.count, default:0),
by:{http.response.status_code},
filter:{
dt.entity.service == "XXXXXXX"
and http.response.status_code == 500
}
Solved! Go to Solution.
25 Sep 2024 07:34 AM
Hi
Have a look at this dashboard on the Playground TEnant - you get a couple of great DQL query examples for e.g: Failure Rate but it also shows some filter options in dashboards: https://wkf10640.apps.dynatrace.com/ui/apps/dynatrace.dashboards/dashboard/29f7a7c0-6c4c-4f02-9a71-a...
25 Sep 2024 07:37 AM
And to your question. You could use the new Metrics Tile in the Dashboard and easily create that DQL simply through point and click and then also see the DQL
25 Sep 2024 08:28 AM
Thank you for your help!
I was able to output the total "reqcount" value.
Please tell us the following in addition.
How do I write a DQL statement that returns 0 if there are no records?
I could not write the following, but it's not working.
timeseries reqcount=sum(dt.service.request.count, default:0) ,
by:{http.response.status_code},
filter:{
dt.entity.service == "XXXXXXXXXXXXXXX"
and http.response.status_code == 500
}
| fieldsAdd result=if(arraySum(reqcount) > 0, arraySum(reqcount), else: 0)
25 Sep 2024 04:02 PM
You can use nonempty:true parameter for timeseries command to ensure that it always returns something
26 Sep 2024 01:51 AM
Resolved. Thank you very much.
I have created a DQL as follows
timeseries reqcount=sum(dt.service.request.count, default:0) ,
nonempty:true,
by:{http.response.status_code},
filter:{
dt.entity.service == "XXXXXXXXXXXXXXX"
and http.response.status_code == 500
}
| fieldsAdd result=if(arraySum(reqcount) > 0, arraySum(reqcount), else: 0)