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

Is it possible to join two nrql query?



I have an alert condition on loadAverageFiveMinute that I use for my db server. I want to somehow ignore it if at the same time a specific transaction is active.

So, something like:

SELECT  * FROM Transaction, SystemSample WHERE appId  = 'appId' and name != 'transactionName' and `hostname` = 'myHostName'   AND loadAverageFiveMinute > 3 SINCE 1 day ago

Is this possible or is there any alternative solution to detect this case to not to trigger the load alert if the transaction is active at that time?


Hi @oguz.karakus

This is what we call a “composite alert condition” and it’s not available in New Relic Alerts out of the box. Although you can, in some cases, wrangle a composite alert condition by using NRQL, the two parts of the composite both need to come from the same event type to work (for example, SELECT average(attribute1) FROM SomeEventType WHERE attribute2 > someLimit).

It might be possible to use the method found in this article to use API calls in a script that make two separate NRQL queries, perform some logic on the results, then use another API call to insert a custom event, which would be what your alert condition actually targets.

Let me know if that gets you pointed in the right direction.


Hi @hross, I wish this was supported without the need for custom implementation.
Thank you for your reply, I will look into that solution.


Thanks @oguz.karakus - let us know if it works for you.