cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I want to create a line chart that displays the failed request count for a selected service

Ganeshmete77
Visitor

I want to create a line chart that displays the failed request count for a selected service
I able to achieve the builtin metrics however when i am trying to do same thing with DQL its not returning the result

Able to get result:
builtin:service.errors.total.rate:filter(and(or(in("dt.entity.service",entitySelector("type(service),entityName.contains(~"(/sbmo-auditlogconsole)~")"))))):splitBy("dt.entity.service"):sort(value(auto,descending))

No result with:
timeseries { count = sum(dt.service.request.count, filter: { failed == true }), count.0 = sum(dt.service.request.count) }, by: { dt.entity.service }, filter: { in(dt.entity.service, classicEntitySelector(concat("type(service),entityName.contains(\" (/sbmo-auditlogconsole)\")"))) }
| fieldsAdd rate = count[] / count.0[]
| sort arraySum(rate) desc
| fieldsAdd entityName(dt.entity.service)
| fieldsRemove count.0, count

2 REPLIES 2

krzysztof_hoja
Dynatrace Champion
Dynatrace Champion

Please try this:

timeseries { count = sum(dt.service.request.count, filter: { failed == true }, default:0), 
  count.0 = sum(dt.service.request.count) } 
  , by: { dt.entity.service }
  , filter: { in(dt.entity.service, classicEntitySelector(concat("type(service),entityName.contains(\" (/sbmo-auditlogconsole)\")"))) }
  , union:true
| fieldsAdd rate = count[] / count.0[]
| sort arraySum(rate) desc
| fieldsAdd entityName(dt.entity.service)
| fieldsRemove count.0, count

 

Without union:true your query will not return where there was completely no data when condition "failed = true" is not fulfilled. 

Additionally adding default:0 will help getting correct result (0) instead of null when there are no failed requests for specific time slots.

Thanks, Its working now.

Featured Posts