Your data. Anywhere you go.

New Relic for iOS or Android

Download on the App Store    Android App on Google play

New Relic Insights App for iOS

Download on the App Store

Learn more

Close icon

Alerting only during certain hours with threshold below 1



I’m working with a group who wants to be alerted when a threshold is zero, meaning transactions stop for a certain period of time. Here’s my NRQL:

SELECT count(*) from Transaction WHERE appName = '<appname>' AND name like '%/<call> (POST)' WITH TIMEZONE 'America/Chicago' WHERE hourOf(timestamp) in ('06:00','07:00','08:00','09:00','10:00','11:00','12:00','13:00','14:00','15:00','16:00','17:00','18:00','19:00','20:00')

I realized, that anything outside of the timestamp will report as zero and set off the alert. I have also noticed that my timestamp seems to move the data outside of the hours I’m searching for by +2 hours. We are in Texas so I assume Chicago represents CST.


Not tied to this question but an observation nonetheless. After midnight, you MUST use 0x:00… for example 1am is ‘01:00’, 1:00 does not match the query.


Hi, @reopelle.scott: You might try making the condition a baseline condition, rather than a static threshold. New Relic Alerts will learn over time that it is normal to have a throughput of 0 at certain hours of the day, and not create an incident during those hours.

Alternatively, you can remove the hours from the NRQL query, and create a script to enable the condition at 6 a.m. and disable it at 8 p.m.


Thanks as always @philweber. I’ve been using the baseline condition. The issue with that method is being unable to specify whether the baseline should be isolated to upper or lower bounds for the alert. We recently had the alert fire because we blew the top off of the baseline, creating a false positive.

Apparently there was never a consideration of alerting condition being under a certain threshold. Rather alerting only when an event is over a threshold. This might be a great idea for an enhancement.


Hi @reopelle.scott, this would be great to add as Feature Idea here on the hub where other users can vote and add their use-cases, as the more support these ideas get the better :smiley: