Clubbing alert conditions with AND condition under one policy

Can we club two or more conditions under a specific policy with AND, OR conditions?
For example, I have one policy & two conditions.

  1. Synthetics condition to check monitor failure
  2. NRQL query to check for specific content.

So here, I want to use AND condition for these two…so that when there is a monitor failure & the NRQL is also satisfied then need to trigger alert.
Is this possible?

2 Likes

Hi @nagendrakunduri - Yes, you can set the policy to fire alerts based on different critieria to meet your requirements.

1 Like

Thanks so much @stefan_garnham! Let us know if you need more direction @nagendrakunduri.

Hello @stefan_garnham
The incident preference helps us to create incidents based on our preference, but I couldn’t find the way to create incident when both my conditions are true.
As per my understanding,
By policy - Creates only one incident for all conditions (so in my case even if one is true it creates incident)
By Condition/By Condition & Entity - Creates incident for each condition, only difference is one groups the violations the other doesn’t group.

1 Like

I am having the same problem, I want to create an alert for a high error rate, however I don’t want it to trigger in the middle of the night because of a few 400 errors that happen during low traffic time.
I’ve been studying NRQL to find out if there is a way to set this up, no luck so far.

1 Like

Hi, @ciro.perez: You should be able to use an NRQL alert condition to do this. Try using a query like this:

SELECT percentage(count(*), WHERE error IS true) 
FROM Transaction 
WHERE appName = 'Your Application'

Then make it a baseline alert condition. New Relic will create a violation when the current query result deviates from the historical baseline at that time of day by the amount you specify.

3 Likes

Hey Phil,
Querying for total error count while making it a baseline condition achieved what I wanted.
Since the baseline will update going forward it will probably be fine.
Thank you for your help!

1 Like

Out of curiosity, could this be done with TransactionError?

Or more directly, is there something TransactionError offers that Transaction does not (or vice versa)?

Hi, @rishav.dhar: The original poster asked about “error rate”. To calculate the error rate, you must know the total number of transactions, so you can calculate what percentage of them have had errors. TransactionError cannot tell you the total number of transactions. It can, however, tell you about the errors themselves: error class, error message, etc.

2 Likes

Thanks for the details, @philweber. I’ve raised a separate thread for my question to avoid mutating this existing thread.

1 Like