Configure the New Relic data source
This document explains how to configure the New Relic data source in Grafana.
Before you begin
Before configuring the data source, ensure you have:
- Grafana permissions: Organization administrator role or datasources:create permission via RBAC.
- New Relic User API key: Also called a Personal API key. To create one, refer to New Relic API keys.
- New Relic Account ID: To find yours, refer to Account ID.
Add the data source
To add the New Relic data source:
- Click Connections in the left-side menu.
- Click Add new connection.
- Type
New Relicin the search bar. - Select New Relic.
- Click Add new data source.
Configure settings
The following table describes the available configuration settings.
Verify the connection
Click Save & test to verify the connection. A successful test displays the message Plugin health check OK.
If the test fails, refer to Troubleshoot New Relic data source issues for guidance on common configuration errors.
Provision the data source
You can define the data source in YAML files as part of Grafana’s provisioning system. For more information about provisioning, refer to Provisioning Grafana.
The following example provisions the New Relic data source:
apiVersion: 1
datasources:
- name: New Relic
type: grafana-newrelic-datasource
jsonData:
region: US
timeoutInSeconds: 300
secureJsonData:
accountId: '<YOUR_ACCOUNT_ID>'
personalApiKey: '<YOUR_PERSONAL_API_KEY>'Replace <YOUR_ACCOUNT_ID> with your New Relic Account ID and <YOUR_PERSONAL_API_KEY> with your User API key.
The following table describes the available provisioning fields:
Provision the data source with Terraform
You can provision the New Relic data source using the Grafana Terraform provider. For more information about Terraform provisioning, refer to Provision Grafana with Terraform.
The following example creates a New Relic data source:
resource "grafana_data_source" "newrelic" {
type = "grafana-newrelic-datasource"
name = "New Relic"
json_data_encoded = jsonencode({
region = "US"
timeoutInSeconds = 300
})
secure_json_data_encoded = jsonencode({
accountId = "<YOUR_ACCOUNT_ID>"
personalApiKey = "<YOUR_PERSONAL_API_KEY>"
})
}Replace <YOUR_ACCOUNT_ID> with your New Relic Account ID and <YOUR_PERSONAL_API_KEY> with your User API key.


