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

Display zero instead of no results

nc1
Visitor

Hi,
I'm trying to create a dashboard tile that will show the number of certificates getting close to expiry. 

I have a DQL query that runs successfully but when there aren't any certificates in the certificate lifecycle 1 : Between 10 and 30, it produces no results.
My dashboard tile displays 'no records' if there are no results for this query, I want the dashboard tile to display a zero. This allows me to assign Thresholds to the dashboard tile so I can give it a red/green status, which I can't do when there a no records. I thought adding a default value to the DQL would create an output of zero, but it doesn't, I still get a result of 'no records'.  timeseries count(certificate.monitor.status, filter: {monitoring_config == "My Certificate Monitoring" AND certificate_lifecycle == "1: Between 10 and 30"}, default:0) Can anyone suggest a way to get value of zero when the DQL returns no results? Thanks

2 REPLIES 2

StrangerThing
DynaMight Pro
DynaMight Pro

You're going to have to use the "default" and "nonempty" parameters: 

timeseries count(certificate.monitor.status, default:0), filter: {monitoring_config == "My Certificate Monitoring" AND certificate_lifecycle == "1: Between 10 and 30"}, nonempty:true
Observability Engineer at FreedomPay

nc1
Visitor

Thank you. That has worked.

Featured Posts