Alert Policy for Scripted Browser Synthetic Monitor

Hi There,
I am new to New Relic and need help with NRQL query.

I have scripted browser monitors setup for an application. It is run on 3 locations. Now, i need an alert policy which would alert us whenever there are 3 or more failure in at least 1 location. As soon as the monitor fails for 1 location atleast 3 times it should trigger an alert and NOT depend on other location failures.

Any help on this is appreciated.

Hi @rajpuroh - New Relic synthetics use a 3 strike basis for failing a synthetic so the synthetic has to fail 3 times consecutively before the synthetic is marked as failed. The documentation also describes multi-location synthetic failure alerting.

Yeah, but my requirement is to trigger a violation whenever there is a failure in even 1 location and NOT wait for simultaneous failure in multiple locations. Is it achievable?

Yes, just set up a basic alert for the synthetic failure :slight_smile:

ohh yeah, i missed to see the “Single Failure” condition that is present already. :slight_smile: :stuck_out_tongue:
Thank you Stefan.

1 Like

Another question on similar lines.
If i want to invoke an alert ONLY if there are 3 consecutive failures of a synthetic monitor from a same location (same single/unique location). How can i achieve this?

Hi, @rajpuroh: As @stefan_garnham mentioned above, New Relic Synthetics automatically tries 3 times before reporting a monitor as failed, so you do not have to do anything.

hey @philweber, what i actually meant is that i’m looking for “three” failed instances of a monitor rather than a single failed monitor which tries for 3 times to mark it as failed.

In short, a monitor if failed 3 times consecutively in a single location, an alert should be triggered, and not when a monitor is marked as failed after 3 auto re-tries of a single location.
I hope i am clear now.

So you actually want it to alert on 9 failures? :slight_smile:

That will be more challenging. You may be able to accomplish it with an NRQL alert condition: If the monitor is set to run every 15 minutes, for example, then you can create a condition whose threshold is, “If the sum of results within 15 minutes is greater than 2”, based on a query like this:

SELECT count(*) 
FROM SyntheticCheck 
WHERE monitorName = 'Your monitor name' 
  AND result = 'FAILED' 
FACET locationLabel

Kind of yes, 9 failures. And if not consecutive 9 failures, at least 9 failures in x minutes.

However, a catch here is that, the scripted browser synthetic test runs in 3 locations. And i want the alert to be invoked even if 1 of those 3 locations report 9 failures.

The above query gives me the count of “failed” results location wise.
I need an alert to be invoked as soon as a single location reports 9 failures in 15 mins. I hope im not complicating my question. :blush:

Please try my suggestion above. :slight_smile:

Thanks @philweber . It is working as expected.