NRQL is New Relic’s SQL-like query language. Try these in the query builder:
SELECT average(cpuPercent) FROM SystemSample FACET hostname SINCE 1 hour ago TIMESERIES
SELECT percentile(duration, 95) FROM Transaction WHERE appName = 'shop-api' SINCE 1 day ago TIMESERIES
SELECT count(*) FROM TransactionError WHERE appName = 'shop-api' FACET error.message SINCE 1 hour ago
Save charts to a dashboard: one row for traffic and latency, one for errors, one for hosts.
Create an alert condition from a query:
- Alerts, Alert conditions, NRQL.
- Query:
SELECT percentage(count(*), WHERE error IS true) FROM Transaction WHERE appName = 'shop-api'. - Threshold: above 5 percent for at least 5 minutes.
- Attach the condition to a policy with a workflow that notifies Slack, email or PagerDuty.
Alert on symptoms users feel (errors, latency) before causes (CPU). Add a muting rule for planned maintenance so deployments do not page anyone.