---
title: Translate Grafana dashboards to New Relic dashboards
source: https://docs.newrelic.com/docs/infrastructure/prometheus-integrations/view-query-data/grafana
---

Convert your existing Grafana dashboards into New Relic native dashboards using our translation REST API. Whether you're looking to consolidate your observability tools, migrate your entire monitoring setup to New Relic, or simply test out New Relic dashboards alongside your existing Grafana setup, this API makes it easier to get started.

This API uses New Relic PromQL translation logic to translate your queries. To see a list of supported PromQL features and functions, see [PromQL features support guide](https://docs.newrelic.com/docs/infrastructure/prometheus-integrations/view-query-data/supported-promql-features).

## Prerequisites [#prerequisites]

Before using this API, you'll need:

-   A [New Relic user API key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#overview-keys)
-   Your New Relic [account ID](https://docs.newrelic.com/docs/accounts/accounts-billing/account-structure/account-id)

## Make a request to the API endpoints [#api-endpoints]

To translate a Grafana dashboard to a New Relic dashboard, send a `POST` request to the appropriate endpoint for your region with the dashboard you want to translate in the body of the request.

-   US: `https://promql-gateway.service.newrelic.com/api/v1/translate/dashboard/grafana`
-   EU: `https://promql-gateway.service.eu.newrelic.com/api/v1/translate/dashboard/grafana`
-   JP: `https://promql-gateway.service.jp.newrelic.com/api/v1/translate/dashboard/grafana`

## API reference [#api-reference]

### Authentication [#authentication]

All API calls require a [user API key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#overview-keys). Include this key in the `api-key` header of your request.

### Request body [#request-body]

The request body must be a JSON object with the following format:

```json
{
  "accountId": int [optional],
  "dashboard": object [required]
}
```

Where dashboard is the Grafana dashboard JSON object you want to translate. The accountId field is optional — if omitted, the translated dashboard will query data from the account of the user making the request.

### Response format [#response-format]

The API returns a JSON object containing the translated New Relic dashboard:

```json
{
  "dashboard": {
    "name": "Translated Dashboard",
    "permissions": "PUBLIC_READ_WRITE",
    "pages": [...]
    }
}
```

## Examples [#examples]

**Example: Basic API call to translate a Grafana dashboard**

````bash
export NR_USER_KEY="YOUR_NEW_RELIC_USER_API_KEY"
export JSON_FILE="my_grafana_dashboard.json"
export TRANSLATOR_ENDPOINT="<TRANSLATOR_ENDPOINT_FOR_YOUR_REGION>" # (see API endpoints section above)

curl -s ${TRANSLATOR_ENDPOINT} \
-H "Content-Type: application/json" \
-H "api-key:${NR_USER_KEY}" \
-d "$(jq -c -n --slurpfile dashboard "${JSON_FILE}" '{dashboard: $dashboard[0]}')" \
| jq '.dashboard'
```

````

**Example: Translate dashboard with account ID override**

If you want to override the account of which your dashboard will query data from, you can include `accountId: int` in the payload of the request. This will make all queries in the dashboard query data from the specified account.

````bash
export NR_USER_KEY="YOUR_NEW_RELIC_USER_API_KEY"
export ACCOUNT_ID="YOUR_NEW_RELIC_STAGING_ACCOUNT_ID"
export JSON_FILE="my_grafana_dashboard.json"
export TRANSLATOR_ENDPOINT="<TRANSLATOR_ENDPOINT_FOR_YOUR_REGION>" # (see API endpoints section above)

curl -s ${TRANSLATOR_ENDPOINT} \
-H "Content-Type: application/json" \
-H "api-key:${NR_USER_KEY}" \
-d "$(jq -c -n --arg accountId "$ACCOUNT_ID" --slurpfile dashboard "$JSON_FILE" '{accountId: $accountId, dashboard: $dashboard[0]}')" \
| jq '.dashboard'
```

````

**Example: Upload translated dashboard to New Relic using NerdGraph API**

> #### 💡 TIP
>
> For more information on how to use NerdGraph and to find your regional endpoint, see [Introduction to New Relic NerdGraph](https://docs.newrelic.com/docs/apis/nerdgraph/get-started/introduction-new-relic-nerdgraph).

````bash
export NR_USER_KEY="YOUR_NEW_RELIC_USER_API_KEY"
export ACCOUNT_ID="YOUR_NEW_RELIC_STAGING_ACCOUNT_ID"
export JSON_FILE="my_grafana_dashboard.json"
export TRANSLATOR_ENDPOINT="<TRANSLATOR_ENDPOINT_FOR_YOUR_REGION>" # (see API endpoints section above)
export NERDGRAPH_ENDPOINT="<NERDGRAPH_ENDPOINT_FOR_YOUR_REGION>"

NR_DASHBOARD=$(curl -s ${TRANSLATOR_ENDPOINT} \
-H "Content-Type: application/json" \
-H "api-key:${NR_USER_KEY}" \
-d "$(jq -c -n --arg accountId "$ACCOUNT_ID" --slurpfile dashboard "$JSON_FILE" '{accountId: $accountId, dashboard: $dashboard[0]}')" \
| jq '.dashboard')


curl -X POST ${NERDGRAPH_ENDPOINT} \
-H "Content-Type: application/json" \
-H "API-Key: ${NR_USER_KEY}" \
-d '{
"query": "mutation($accountId: Int!, $dashboard: DashboardInput!) { dashboardCreate(accountId: $accountId, dashboard: $dashboard) { entityResult { guid name } errors { description } } }",
"variables": {
"accountId": '${ACCOUNT_ID}',
"dashboard": '${NR_DASHBOARD}'
}
}'
```

````

## Troubleshoot translation errors [#troubleshooting]

When the translator encounters issues that prevent complete translation of a widget or query, it creates "Action Items" — special Markdown widgets that explain what went wrong and suggest fixes.

![Action Item Example](https://docs.newrelic.com/images/grafana_dashboard_translator_action_items.webp "Translator action item example")

## Grafana and New Relic widget types

The following is a list of Grafana widget types that we support and their corresponding New Relic widget types.

| Grafana widget type                                                                                                            | New Relic widget type                                                                                                   |
| ------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
| [singlestat](https://grafana.com/docs/grafana/latest/visualizations/panels-visualizations/) _(deprecated)_                     | [BILLBOARD](https://docs.newrelic.com/docs/query-your-data/explore-query-data/use-charts/chart-types/#widget-billboard) |
| [stat](https://grafana.com/docs/grafana/latest/visualizations/panels-visualizations/visualizations/stat/)                      | [BILLBOARD](https://docs.newrelic.com/docs/query-your-data/explore-query-data/use-charts/chart-types/#widget-billboard) |
| [bargauge](https://grafana.com/docs/grafana/latest/visualizations/panels-visualizations/visualizations/bar-gauge/)             | [BILLBOARD](https://docs.newrelic.com/docs/query-your-data/explore-query-data/use-charts/chart-types/#widget-billboard) |
| [gauge](https://grafana.com/docs/grafana/latest/visualizations/panels-visualizations/visualizations/gauge/)                    | [BULLET](https://docs.newrelic.com/docs/query-your-data/explore-query-data/use-charts/chart-types/#widget-bullet)       |
| [table](https://grafana.com/docs/grafana/latest/visualizations/panels-visualizations/visualizations/table/)                    | [TABLE](https://docs.newrelic.com/docs/query-your-data/explore-query-data/use-charts/chart-types/#widget-table)         |
| [graph (line chart)](https://grafana.com/docs/grafana/latest/visualizations/panels-visualizations/visualizations/time-series/) | [LINE](https://docs.newrelic.com/docs/query-your-data/explore-query-data/use-charts/chart-types/#widget-line)           |
| [graph (area chart)](https://grafana.com/docs/grafana/latest/visualizations/panels-visualizations/visualizations/time-series/) | [AREA](https://docs.newrelic.com/docs/query-your-data/explore-query-data/use-charts/chart-types/#widget-area)           |
| [text](https://grafana.com/docs/grafana/latest/visualizations/panels-visualizations/visualizations/text/)                      | [MARKDOWN](https://docs.newrelic.com/docs/query-your-data/explore-query-data/use-charts/chart-types/#widget-markdown)   |
| [piechart](https://grafana.com/docs/grafana/latest/visualizations/panels-visualizations/visualizations/pie-chart/)             | [PIE](https://docs.newrelic.com/docs/query-your-data/explore-query-data/use-charts/chart-types/#widget-pie)             |
| [heatmap](https://grafana.com/docs/grafana/latest/visualizations/panels-visualizations/visualizations/heatmap/)                | [HEATMAP](https://docs.newrelic.com/docs/query-your-data/explore-query-data/use-charts/chart-types/#widget-heat-map)    |
| [bar-chart](https://grafana.com/docs/grafana/latest/visualizations/panels-visualizations/visualizations/bar-chart/)            | [BAR](https://docs.newrelic.com/docs/query-your-data/explore-query-data/use-charts/chart-types/#widget-bar)             |
| [barchart](https://grafana.com/docs/grafana/latest/visualizations/panels-visualizations/visualizations/bar-chart/)             | [BAR](https://docs.newrelic.com/docs/query-your-data/explore-query-data/use-charts/chart-types/#widget-bar)             |
