NRQL Baseline Alerts - Not Triggering

Background: We are using New Relic API for sending logs information to new Relic from Mirth connect.

Requirement: We want to trigger Alerts when we don’t receive any logs from Mirth into New Relic, based on below conditions:

  1. From 6 AM Monday thru 10 PM Friday, we should have alert set to 30 mins. ( means if we are not receiving any messages from Mirth to New Relic for 30 mins, an alert should be triggered)

  2. From 10:01 PM Friday thru 5:59 AM Monday we should have the alert set to 1 hour, as messages flow would be less. ( means if we are not receiving any messages from Mirth to New Relic for 1 hour, an alert should be triggered).

So this alert would vary based on time and day of week.

Question: What would be the best approach to apply these alerts using NRQL query. I tried using baseline query, but somehow those alerts are not triggered as per requirement. Please advise.

Hi @kraina

Welcome to our Explorers Hub! :grin:

Reading the description of your requirement, I believe that a combination of a Synthetic Monitor and an alert condition that will create incidents in case this monitor fails would create the type of notifications that you need.

A brief example:

You can create a Scripted Synthetic monitor that will run every 30 minutes and each time it will query the Log events in New Relic using the Insights API.

The script of this monitor can check what is the day of the week and time that it is executing and query the logs in the past 30 or 60 minutes depending on the day of the week.

If the query doesn’t return any logs in the expected windows, you can set the monitor to fail and an incident will be created from it.

You can find a similar example on [this solution] that I’ve written, where instead of checking the “hours” of the time window, it can check what is the day of the week and hour, run the right query and fail if there are no logs reported.


Please let me know if you have any doubts and I’ll be happy to help you.

Regards,

Rodrigo