• Log inFree account

Create your first alert

Use our New Relic query language (NRQL) to create alerts conditions with ease.

Your condition describes what you want to be notified about, and only requires two attributes: a query and a threshold. The query defines the data that's important to you, and determines what you want to be notified about. The threshold determines when you’ll be notified.

Follow these steps to write your first alerts condition using a NRQL query and a threshold. Once you're done, you'll have a working alert condition.

Ready to get started? Make sure you have a New Relic account. It's free, forever!

Step 1: Write your query

You can use a NRQL query to return data about how your environment is performing. Then, you can create a condition from that query.

In this example, a condition is created for each host's CPU utilization (query), which will trigger a notification when the CPU utilization is above the 0.7% (threshold). Generally, you won't use thresholds below 1%, but this example simply shows you how to set up a threshold.

Find the NRQL query builder at the top of the UI.

A screenshot showing where you can find the NRQL query builder button in the UI.

Click the Query your data button to open the query builder and start writing a NRQL query. Once you've written a valid query, you can create a condition from it.

The condition shows each host's CPU utilization. Use this NRQL query, or something similar that's relevant to what you're monitoring, to create a condition.

A screenshot of a NRQL query that finds the average CPU utilization faceted by hostname.

This query finds the average CPU utilization in an environment and then breaks it down (facets) by individual host names.

Once you've created a valid NRQL query, run it. Next, click Create alert.

Learn more about the NRQL syntax to create other useful queries.

Step 2: Name your NRQL condition

Give your NRQL condition a name that's meaningful to you.

Step 3: Set your condition thresholds

Set critical and warning thresholds to determine when you’re notified about your environment's performance.

  • A critical threshold is required for your alerts condition.

  • A warning threshold is optional. These thresholds don't create an incident or notify you like the critical threshold does. If a critical threshold opens an incident and notifies you, warning threshold violations created afterwards will be included in the report.

In this example from the Set your condition thresholds section, our critical threshold (red) checks for any hosts with CPU utilization over 0.7% for at least 5 minutes. A warning threshold (yellow) is also added showing when any host's CPU utilization goes over 0.67% for at least 5 minutes.

A visualization of the NRQL query with critical and warning threshold lines.

After you enter threshold values, you can see the threshold lines on the graph:

The query's visualization shows each host’s average CPU utilization.

Step 4: Create a policy

Finally, add your condition to an existing policy or create a new one.

A screenshot of the Policy section for the Create alert form.

When you create a new policy, you can group your violations by policy, condition, or by violation (this creates an incident for each violation). These incident preferences settings determine how frequently you're notified when there's a violation.

What's next?

Now that you've created your first condition, set up your incident preferences and notification channels.

For a detailed, comprehensive overview of NRQL conditions, see Create NRQL alert conditions

Copyright © 2022 New Relic Inc.