New Relic

Data SourceENTERPRISE

The official New Relic data source from Grafana Labs
Enterprise

Enterprise 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 the New Relic plugin, go to Data Sources in the menu, click on the Add data source button, and choose New Relic as the type. Fill in a name for the data source (for example, New Relic).

Add your New Relic Admin API Key, which you can generate from INTEGRATIONS -> API keys in your New Relic account settings. For the Personal API Key, find instructions on how to generate this key here. For the Account ID, you can find it here.

Data Source Config

Usage

Query Editor

The query editor has two modes. The first one allows querying New Relic APM via New Relic's REST API. The second one supports New Relic Insights and provides a query editor for New Relic Query Language (NRQL).

New Relic Insights

Select Insights in the Service field. You'll see an input field for a NRQL query. As you start to type, you'll see words 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 the writing experience when creating NRQL queries, our editor supports macros which convert into real values when the query is invoked. Example:

  • $__timeFilter will convert into the SINCE <from> UNTIL <to> clause based on your dashboard's time range.

Our editor also supports template variables that are available for use in the query as $variable_name or [[variable_name]].

insights_tempvar_macros

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

insights_help

New Relic APM

Select New Relic in the Service field. The query editor allows you to select the metric source type (Application or Plugin), metric name, and value.

query editor

simple graph

Aliases

The New Relic plugin supports advanced alias patterns and special variables.

The 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

You can combine plain text with variables to set desired alias. For example: Server: $__nr_server Metric: $__nr_metric.

Templating

The New Relic data source supports template variables. You can fetch different types of data to use as template variable values. In the query section, you can get list of available applications or plugins:

  • applications or applications/[nameFilter]: list of applications
  • components or components/[nameFilter]: list of components (plugins)

where [nameFilter] is an optional name filter.

Templating_1

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

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

For example, servers/62535318/metrics/. It may not be as useful to write the IDs of your apps or servers so you may want to combine these endpoints with first type of variables. For example:

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

Using this method will allow you to choose an application and get a list of metrics in the $appMetrics variable.

NRQL queries

NRQL queries can be defined in the Query field to be used as a template variable when working with the New Relic data source.

Example:

SELECT uniques(entityAndInterface) FROM NetworkSample

Multi-value variables support

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

Multi-value variable

Annotations

Annotations allow you 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, please use template variables because you will be able to select the entity name instead of ID. For example, to filter events for a particular application, create a variable _$app_ which retrieves a list of apps and uses it as an Entity ID filter.

Getting deployments

Application ID is required field.

Annotations editor (deployments)

Sign up Now

Version

Dependencies:
  • Grafana 7.0.x