New Relic

Data SourcePREMIUM

The official New Relic data source from Grafana Labs

Premium plugins, along with support and assistance from the core team behind Grafana, are available with Grafana Enterprise.

Please sign up or log in to get started.

Sign Up

New Relic Data Source

This is a Grafana data source for showing metrics from the New Relic APM (application performance monitoring).

Configuration

After installing New Relic plugin, go to Datasources in the menu, click on the Add datasource button and then choose New Relic from Type dropdown and fill in a name for the data source (for example New Relic). Add your New Relic's REST API key, which you can generate from INTEGRATIONS -> API keys page in your New Relic account settings. For using Insights, specify your Insights API key (Insights -> Manage Data -> API keys -> Query Keys) and Accounty ID (get it from page URL: https://insights.newrelic.com/accounts/<your_account_id>/manage/api_keys or from query example on the API keys page).

Data Source config

Usage

Query Editor

Query editor has two modes. A first one allows querying New Relic APM via New Relic REST API. Second one supports New Relic Insights and provides query editor for New Relic Query Language (NRQL).

New Relic Insights

Select Insights in Service field. You'll see input field for NRQL query. Start to type and use autocomplete.

insights_autocomplete

insights_fullquery

For more information about advanced queries - visit <u><a href='https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions'>NRQL docs</a></u>.

Macros and template variables

In order to improve experience when writing NRQL queries, editor supports macros which are converting into real values when query is invoked. There's a list supported macros:

  • $__timeFilter is converting into SINCE <from> UNTIL <to> clause based on dahboard's time range.

Editor also support template variables that are available for use in the query via $variable_name or [[variable_name]].

insights_tempvar_macros

For hints on how to use macros and template variables - refer to help section in the editor.

insights_help

New Relic APM

Select New Relic in Service field. Query editor is very simple, just select metric source type (Application, Server or Plugin are supported), select needed app, server or component (plugin), then choose metric and value.

query editor

simple graph

Aliases

New Relic plugin supports advanced alias patterns and special variables. Default alias is $__nr_metric: $__nr_metric_value, but you can rewrite it using these variables:

Variable              Description             Example
$__nr_metric          Metric name             CPU/User time
$__nr_metric_value    Metric values           average_value
$__nr_application     Application name
$__nr_server          Server name
$__nr_component       Plugin name

Combine plain text with variables to set desired alias, for example: Server: $__nr_server Metric: $__nr_metric.

Templating

New Relic data source support template variables. You can fetch different type of data for using as template variable values. First, you can get list of available applications, servers or plugins:

applications or applications/[nameFilter] - list of applications
servers or servers/[nameFilter] - list of servers
components or components/[nameFilter] - list of components (plugins)

where [nameFilter] is optional name filter.

Templating_1

Also, you can pull list of available metrics from particular application, server or component. Use these formats:

applications/{application_id}/metrics/
servers/{application_id}/metrics/
components/{application_id}/metrics/

For example, servers/62535318/metrics/. It isn't so useful to write id's of your apps or servers, so better to combine these endpoints with first type of variables, for example:

Variable       Query
$app           applications
$appMetrics    applications/$app/metrics

By this way you can choose application and get list of metrics in $appMetrics variable.

Multi-value variables support

You can set your variable as multi-value. These variables are supported in Metric and Value fields. So you can select several metrics using one query.

Multi-value variable

Annotations

Annotations allow to get alerts and deployments events from New Relic and display it on graphs.

Getting alert events

Annotations editor (alerts)

Select your New Relic data source and set additional filters. Without any filters set all events will be returned. If you want to filter events by Entity ID, better to use template variables because in this case you can select entity name instead of ID. For example, to filter events for particular application create a variable $app which retrieves a list of apps and use it as Entity ID filter.

Getting deployments

Application ID is required field.

Annotations editor (deployments)

Install Plugin

Version

Dependencies:
  • Grafana ^5.2.1