Compound alerts
Compound alerts are cool, and a commonly requested feature. What are compound alerts? Simply stated, it’s when you set up multiple thresholds that are dependent upon one another. For example, I could set up a condition that would violate when my app’s CPU usage went over 90%, and another alert condition that would violate when my app’s memory usage went over 90%. A compound alert would not open an incident unless both states were present.
Up until recently, it has not been possible to set up compound alerts out-of-the-box in New Relic. Now that we have workflows, however, you can do it – I’ll show you how below.
How to get notified on a compound alert
Configuring conditions
- Select
Alert conditions (Policies)
on the sidebar. - Choose an existing policy or create a new one to contain your conditions.
- Create conditions according to your needs in the policy.
- Make sure Incident Preference is set to By policy.
- Make sure the Correlate and suppress noise box is NOT checked.
- (optional) If you only want “compound alert” notifications, make sure that no notification channels are attached to the policy.
Configuring destinations
- Select
Destinations
on the sidebar. - Create one or more destinations where you would like to be notified.
Configuring a workflow
- Select
Workflows
on the sidebar. - Click on
Add a workflow
to create a new workflow. - Under Select issues, click
Build a query
. - Click
Select or enter attribute
. - In the Filter your data section in the new workflow choose attribute
conditionFamilyId
, operatorexactly matches
, and enter the value of the first condition ID (for the condition id location see Screenshot 1 below). - Click on the
+ AND
button and repeat the process with the second condition id (see Screenshot 2 for an example of what this should look like). - In the Notify section choose your configured destination and decide what the payload is going to look like.
Screenshot 1:
Screenshot 2:
**
And that’s it! This workflow will only open an Issue (and thus send notifications) when both conditions have opened an incident.