Connect to a New Relic data source - Amazon Managed Grafana

Connect to a New Relic data source

This section covers New Relic APM and Insights for Grafana.

Note

This data source is for Grafana Enterprise only. For more information, see Manage access to Enterprise plugins.

Additionally, in workspaces that support version 9 or newer, this data source might require you to install the appropriate plugin. For more information, see Extend your workspace with plugins.

Features

  • Template variables

    • Metric names

    • Metric values

  • Annotations

  • Aliasing

    • Metric names

    • Metric values

  • Ad-hoc filters

    • Not currently supported

  • Alerting

Configuration

Add the data source, filling out the fields for your admin API key, personal API key and account ID.

Usage

Service types

  • Metrics; for querying New Relic APM via New Relic’s REST API.

  • Insights; for querying New Relic Insights via NRQL.

Aliases

You can combine plaintext with the following variables to produce custom output.

Variable Description Example value
$__nr_metric Metric name CPU/User time
$__nr_metric_value Metric values average_value

For example:

<para> Server: $__nr_server Metric: $__nr_metric </para> <programlisting>

Templates and variables

  1. Create a template variable for your dashboard. For more information, see Templates and variables.

  2. Select the "Query" type.

  3. Select the "New Relic" data source.

  4. Formulate a query using relative REST API endpoints (excluding file extensions).

List of available applications:

<para> applications </para> <programlisting>

List of available metrics for an application:

<para> applications/{application_id}/metrics </para> <programlisting>

NRQL macros

To improve the writing experience when creating New Relic Query Language (NRQL) queries, the editor supports predefined macros:

  • $__timeFilter (or [[timeFilter]]) will interpolate to SINCE &lt;from&gt; UNTIL &lt;to&gt; based on your dashboard’s time range.

Example:

<para> SELECT average(value) FROM $event_template_variable $__timeFilter TIMESERIES </para> <programlisting>

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

Alert events

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, 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.

Deployment events

Application ID is a required field.