The New Relic Query Language (NRQL) is a powerful tool you can use to query and understand nearly any type of data, but it can seem overwhelming at first glance. Don't worry! Here is some information to give you a good foundational understanding of NRQL, including what it is, how to use it, and some tips and tricks that will help you get the most out of your queries. Once you've learned about NRQL, you can capture and interpret your data, letting you break down the big picture into easily understandable pieces and helping you identify problems as they occur.
Here's a quick video to help introduce you to using NRQL by showing you how to find a query from a dashboard and modify it in the query builder. For more detailed information on querying, including a listing of clauses and functions and example queries, see NRQL syntax, clauses, and functions.
If you haven't already, be sure to sign up for a New Relic account (it's free, forever). Let's get started!
NRQL is an acronym of New Relic query language. It's a query language similar to ANSI SQL (see the syntax), and is used to retrieve detailed New Relic data and get insight into your applications, hosts, and business-important activity. NRQL can help you:
- Create a new chart
- Answer a specific question for the purpose of troubleshooting or business analysis
- Set up NRQL-based alerts (our primary and most powerful type of alert)
- Make API queries of New Relic data (for example, using our NerdGraph API)
You can use NRQL to create simple queries, such as fetching rows of data in a raw tabular form to give insight on individual events. You can also use NRQL to run powerful calculations on the data before it's presented to you, such as crafting funnels based on how end users are using your site or application.
We use NRQL behind the scenes to generate many of the charts and dashboards in our curated UI experiences:
Many of our charts and visualizations are built using NRQL. One way to get started using NRQL is to view a chart's query and then edit it to make your own custom chart.
NRQL is used in many places to access your data. Those places include:
NRQL is one of several ways to query New Relic data. For more on all query options, see Query your data.
NRQL lets you query nearly every type of our telemetry data, including:
- Event data from all New Relic products. Examples include:
- Metric timeslice data (metrics reported by APM)
Metricdata type (metrics reported by the Metric API and data sources that use that API)
Spandata type (distributed tracing data)
Logdata type (data from our log management capabilities)
Some data, like relationships between monitored entities, is not available via NRQL but is available using our NerdGraph API.