New Relic alerting
The New Relic data source supports Grafana Alerting, allowing you to create alert rules based on New Relic data. You can monitor your applications, infrastructure, and custom metrics and receive notifications when specific conditions are met.
Before you begin
- Ensure you have the appropriate permissions to create alert rules in Grafana.
- Verify your New Relic data source is configured and working correctly.
- Familiarize yourself with Grafana Alerting concepts.
Supported query types for alerting
The following query types work with Grafana Alerting:
Note
Alert queries must return numeric data that Grafana can evaluate against a threshold. The Logs and Traces query types aren’t suitable for threshold-based alerting because they return non-numeric data.
Warning
When using the NRQL Editor or Data Explorer for alerting, set the Format to
Tableand omit theTIMESERIESkeyword from your query. The time-series format may produce frames that Grafana Alerting can’t evaluate, resulting ininput data must be a wide serieserrors.
Create an alert rule
To create an alert rule using New Relic data:
- Go to Alerting > Alert rules.
- Click New alert rule.
- Enter a name for your alert rule.
- In the Define query and alert condition section:
- Select your New Relic data source.
- Configure your query (for example, a NRQL query for average response time).
- Set the alert condition: the When input defines the reducer function, and the last input defines the threshold.
- Configure the Set evaluation behavior:
- Select or create a folder and evaluation group.
- Set the evaluation interval (how often the alert is checked).
- Set the pending period (how long the condition must be true before firing).
- Add labels and annotations to provide context for notifications.
- Click Save rule.
For detailed instructions, refer to Create a Grafana-managed alert rule.
Alert examples
The following examples show common alert patterns using different query types.
Error rate alert (NRQL Editor)
Alert when the application error rate exceeds 5%:
Create a new alert rule.
Select the NRQL Editor query type, set Format to
Table, and enter:SELECT percentage(count(*), WHERE error IS true) FROM Transaction WHERE appName = 'my-app' $__timeFilterSet the alert condition: set When to
Lastand the threshold to Is above 5.Set evaluation to run every 1 minute with a 5-minute pending period.
Save the rule.
Response time alert (NRQL Editor)
Alert when average response time exceeds 2 seconds:
SELECT average(duration) FROM Transaction WHERE appName = 'my-app' $__timeFilterSet Format to Table. Set the alert condition threshold to Is above 2.
Throughput drop alert (NRQL Editor)
Alert when request throughput drops below a minimum threshold:
SELECT rate(count(*), 1 minute) FROM Transaction WHERE appName = 'my-app' $__timeFilterSet Format to Table. Set the alert condition threshold to Is below 100.
Apdex score alert (NRQL Editor)
Alert when the Apdex score falls below an acceptable level:
SELECT apdex(duration, 0.5) FROM Transaction WHERE appName = 'my-app' $__timeFilterSet Format to Table. Set the alert condition threshold to Is below 0.85.
Best practices
Follow these recommendations to create reliable alerts with New Relic data.
Include the time filter macro
Always include $__timeFilter in NRQL alert queries so the query evaluates data within the alert evaluation window:
SELECT average(duration) FROM Transaction WHERE appName = 'my-app' $__timeFilterReduce multiple series
When your query returns multiple time series (for example, queries with FACET), configure the When reducer in the alert condition to aggregate them into a single value:
- Last — Use the most recent value.
- Mean — Average across all series.
- Max/Min — Use the highest or lowest value.
- Sum — Total across all series.
For complex multi-query setups, switch to Advanced mode and add separate Reduce and Threshold expressions.
Test queries before creating alerts
Always verify your query returns expected data before creating an alert:
- Go to Explore.
- Select your New Relic data source.
- Run the query you plan to use for alerting.
- Confirm the data format and values are correct.
Handle no data and error conditions
Configure what happens when no data is returned or when a query error occurs:
- In the alert rule, find Configure no data and error handling.
- For Alert state if no data or all values are null, choose an appropriate action:
- No Data — Set the alert state to
No Data. - Alerting — Treat no data as an active alert.
- OK — Treat no data as a healthy state.
- No Data — Set the alert state to
Tip
New Relic queries can return no data if the application has no recent traffic. Use the OK option for low-traffic applications to avoid false alerts.
Troubleshoot alerting issues
For common alerting issues with the New Relic data source, refer to Alerting issues in the troubleshooting guide.


