Connect Grafana to Azure Monitor managed service for Prometheus

The most common way to analyze and present Prometheus data is with a Grafana dashboard. This article explains how to configure Azure Monitor managed service for Prometheus as a data source for different versions of Grafana including Azure Managed Grafana, self-hosted Grafana running on an Azure VM, and a Grafana instance running outside Azure.

Important

Azure Monitor dashboards with Grafana is now in public preview. This version of Grafana is hosted in Azure and requires no configuration to connect to Azure Monitor managed service for Prometheus. This article describes how to connect to an Azure Monitor workspace to include Prometheus metrics in other versions of Grafana that do require configuration.

Azure Monitor workspace query endpoint

Azure Monitor managed service for Prometheus stores data in an Azure Monitor workspace. Each version of Grafana uses the query endpoint for this workspace to access it. To find the query endpoint, open the Overview page for your Azure Monitor workspace in the Azure portal.

Screenshot that shows the query endpoint URL for an Azure Monitor workspace.

Configure Grafana

An Azure Managed Grafana instance is automatically configured with a managed identity with the Monitoring Data Reader role required to allow the identity to read any monitoring data for the subscription. The identity is used to authenticate Grafana to Azure Monitor.

Create the Prometheus data source in Grafana

Use the following steps to configure Prometheus as a data source:

  1. Open your Azure Managed Grafana workspace in the Azure portal and select the endpoint to view the Grafana workspace.

  2. Select Connections > Data sources and then Add data source.

  3. Search for and select Prometheus.

  4. Paste the query endpoint from your Azure Monitor workspace into the Prometheus server URL field.

  5. Under Authentication, select Azure Auth.

  6. Under Azure Authentication, select Managed Identity from the Authentication dropdown list.

  7. Scroll to the bottom of the page and select Save & test.

    Screenshot that shows configuration for Prometheus data source.