Back to top icon

New Relic Developers

Do more with your data

Use our powerful querying language to create custom dashboards and alerts.

 

Learn NRQL

You can use the New Relic Query Language (NRQL) in New Relic Insights to build custom dashboards, perform advanced analytics and debugging, and extend your monitoring and analysis in new directions.

This is an example Insights dashboard. Each chart on this dashboard was created with a unique NRQL query that fetched core data from one of our products: APM, Infrastructure, Synthetics, Mobile, Browser. You can view these query strings below and try running them in your own account.

Learn NRQL

APM:

-- Fetch all APM transactions that took longer than two seconds for the last day across all of your applications
SELECT * FROM Transaction WHERE duration > 2 SINCE 1 day ago

Browser:

-- Show the slowest average page loads in the last week for all requests made outside the US grouped by their URL
SELECT average(duration) FROM PageView WHERE countryCode != 'US' SINCE this week FACET pageUrl

Infrastructure:

-- Select advanced CPU metrics and plot them alongside their aggregate over the last hour and plot it the data as a line chart
SELECT average(cpuSystemPercent), average(cpuIOWaitPercent), average(cpuUserPercent), average(cpuStealPercent) FROM SystemSample SINCE 60 minutes ago TIMESERIES auto

Mobile:

-- Show which regions of China have the most users for my Mobile apps
SELECT uniqueCount(uuid) FROM MobileSession WHERE countryCode='CN' FACET regionCode SINCE 7 days ago

Synthetics:

-- Generate a simple SLA chart consisting of the average duration for and success rate of Synthetic checks grouped by the date
SELECT average(duration), percentage(count(*), WHERE result='SUCCESS') FROM SyntheticCheck FACET dateOf(timestamp) SINCE 1 week ago
Visualize your data

Use NRQL to craft custom dashboards and stay on top of what's happening on your team and in your business. Check out the example dashboards below to get some inspiration.

Dashboard visualization of specific user engagements across the entire stack of an ecommerce site—visits by country, purchases by device and by country, conversions with slow back-end, average order value, database performance, etc. 

Exec Dashboard 1

Dashboard visualization of key cloud migration trends. You can easily understand and share progress toward your goals with technical and non-technical stakeholders alike.

Cloud Migration

Dashboard visualization of DevOps efficiency. Track deployments, code commits, support tickets, times to resolution, and more stats to ensure high-quality team performance.

Cloud Migration
Advanced custom alerting

NRQL also lets you create custom alerts in New Relic Alerts, so you can stay ahead of the issues that you care about most.

This is an example of dynamic baselines, an alerting capability that lets you set thresholds and automatically notifies you about anomalies in your target NRQL query.

NRQL Alerts

Example alert query.

-- Alert on anamolies in the average response time for an application named 'WebPortal'
SELECT average(duration) FROM PageView WHERE appName = 'WebPortal'