Yearly Uptime Report

Folks, I am trying to create a yearly uptime report categorized by Month.

I am using the following nrql to try setting this up,

SELECT filter(percentage(count(*), WHERE MonitorType =‘SimplePing’ AND result =‘SUCCESS’ AND monthOf(timestamp) LIKE ‘June%’ AS ‘June’))FROM SyntheticCheck SINCE this year

However I get the error
Argument error, expected: filter(function, WHERE expression) (at line 0 column 7)

Once I can get this to work for one month then i’ll complete the query to incorporate all 12 months

I have a similar query working fine where I use just filter(count(*) without the percentage and it works fine, an example of which is as follows,

SELECT filter(count() , WHERE
result=‘Success’ AND MonitorType = ‘SimplePing’ AND
monthOf(timestamp) LIKE ‘January%’) AS ‘January’,filter(count(
) ,
WHERE result=‘FAILED’ AND monthOf(timestamp) LIKE ‘February%’) AS
‘February’ FROM SyntheticCheck FACET MonitorName SINCE this year

Any ideas why I might be having issues with the SELECT filter(percentage(count(*)

So I may have an answer for this, this looks like it might well do the job,

SELECT percentage(count(*), WHERE result =‘SUCCESS’ AND MonitorType =‘SimplePing’ AND yearOf(timestamp) LIKE ‘2016%’) FROM SyntheticCheck SINCE this year FACET monthOf(timestamp)

1 Like

Hey Lambert! Did it work? We would love it if you would share this in the library of useful NRQL queries here: Useful Insights NRQL queries library.


1 Like

HI @hross, just posted the query to the forum. Hope it helps other folks :slight_smile:


Thanks so much @lambert! That makes my Thursday.