• /
  • EnglishEspañolFrançais日本語한국어Português
  • 로그인지금 시작하기

Get started with NRQL: The language of data

New Relic Query Language (NRQL) is a SQL-like language for querying your New Relic data. The same query language that powers New Relic's built-in charts and dashboards is available to you, so you can build the views and alerts your team needs.

Here's a 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, functions, and example queries, see our NRQL reference.

What you can do with NRQL

Use NRQL to:

  • Build charts that show transaction throughput, error rates, or latency over time
  • Answer a specific question for the purpose of troubleshooting or business analysis
  • Investigate a performance issue by querying the specific events and attributes involved
  • Set up NRQL-based alerts that fire when a metric crosses a threshold
  • Make API queries for your New Relic data for example, using our NerdGraph API.

NRQL works for both basic queries (fetching raw rows of event data) and calculated results, such as funnels based on how users interact with your site or application.

New Relic uses NRQL internally to power the charts and dashboards in the New Relic platform. That same query language is available to you.

Queryable data types

NRQL lets you query nearly every type of our telemetry data, including:

Some data, like relationships between monitored entities, is not available via NRQL but is available using our NerdGraph API.

Where to use NRQL

NRQL is available across the platform:

A screenshot of a NRQL query chart

Access the query builder through the Query your data drawer at the bottom of any New Relic page to run queries and create custom charts.

You can run an NRQL query in the query builder within the platform. This NRQL query shows a count of distributed tracing spans faceted by their entity names.

A screenshot of the Nerdgraph API

You can also use NRQL with our NerdGraph API. This lets you run cross-account queries and asynchronous queries that aren't available in the UI.

NRQL query structure

NRQL follows a structured, clause-based syntax. Here's an NRQL query that counts all transactions in the last hour:

SELECT count(*) FROM Transaction SINCE 1 hour ago

Here's a breakdown of all available clauses:

SELECT function(attribute) [AS 'label'][, ...] 
  FROM data type
  [WHERE attribute [comparison] [AND|OR ...]][AS 'label'][, ...]
  [FACET attribute | function(attribute)]
  [LIMIT number]
  [SINCE time]
  [UNTIL time]
  [WITH TIMEZONE timezone]
  [COMPARE WITH time]
  [TIMESERIES time]

Here are the rules that NRQL follows:

NRQL rule

Details

Required values

The SELECT clause and FROM clause are required. All other clauses are optional. You can start your query with either SELECT or FROM.

Query string size

The query string must be less than 4 KB.

Case sensitivity

Data type names and attribute names are case sensitive. NRQL clauses and functions aren't case sensitive.

Syntax for strings

NRQL uses single quotes to designate strings. The following example shows the syntax:

... WHERE traceId = '030a573f0df02c57'

Non-standard custom event and attribute names

Events that we report by default have names that contain alphanumeric characters, colons (:), and underscores (_). Attribute names can have those characters and periods (.). Default-reported names start with a letter. You must enclose custom names that don't follow these guidelines in backticks in NRQL queries. The following example shows a custom name enclosed in backticks:

... FACET `Logged-in user`

Data type coercion

We don't support data type "coercion." For more information, see Data type conversion.

For more information, see our NRQL reference to help you build your queries.

Next steps

Copyright © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.