New Relic Cheat Sheet
Reference for New Relic APM agent setup, NRQL query syntax, and alert condition configuration for application performance monitoring.
2 PagesIntermediateFeb 8, 2026
NRQL Basics
Common NRQL query patterns against APM event data.
sql
-- Average response time for a transaction, last 30 minSELECT average(duration) FROM TransactionWHERE appName = 'checkout-service' SINCE 30 minutes ago-- Error rate grouped by time bucketSELECT percentage(count(*), WHERE error IS true) FROM TransactionTIMESERIES 5 minutes-- Top 5 slowest transactionsSELECT average(duration) FROM TransactionFACET name ORDER BY average(duration) DESC LIMIT 5
Agent Configuration
newrelic.yml key settings for a Node.js/Python agent.
yaml
common: &default_settings license_key: <YOUR_LICENSE_KEY> app_name: checkout-service distributed_tracing: enabled: true logging: level: infoproduction: <<: *default_settings
Key Concepts
Core New Relic terminology.
- APM agent- Language-specific library instrumenting an app to report transactions/traces
- NRQL- SQL-like query language for querying New Relic's event/metric data
- entity- A monitored object (app, host, service) with its own health and dashboards
- alert condition- A threshold on an NRQL query or metric that triggers a violation/notification
- distributed tracing- Correlates spans across services for a single request into one trace
NRQL Alert Condition
A static threshold alert condition definition.
json
{ "nrql": { "query": "SELECT average(duration) FROM Transaction WHERE appName = 'checkout-service'" }, "terms": [ { "threshold": "2", "thresholdOccurrences": "ALL", "thresholdDuration": 300, "operator": "ABOVE", "priority": "CRITICAL" } ]}
Pro Tip
Use FACET with TIMESERIES together in NRQL to spot which specific transaction or host is driving an aggregate spike, rather than alerting only on overall averages that can hide localized problems.
Was this cheat sheet helpful?
Explore Topics
#NewRelic#NewRelicCheatSheet#DevOps#Intermediate#NRQLBasics#AgentConfiguration#KeyConcepts#NRQLAlertCondition#Databases#CheatSheet#SkillVeris