Edit

Share via


Connect Grafana to Azure Monitor Prometheus metrics

The most common way to analyze and present Prometheus data is with a Grafana dashboard. You can collect Prometheus metrics in Azure in the following ways:

This article explains how to configure Azure-hosted Prometheus metrics as a data source for Azure Managed Grafana, self-hosted Grafana running on an Azure VM, or a Grafana instance running outside Azure.

Azure Monitor workspace query endpoint

In Azure, Prometheus data is stored in an Azure Monitor workspace. When you configure the Prometheus data source in Grafana, you use the query endpoint for your Azure Monitor workspace. 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

Azure Managed Grafana

An Azure Managed Grafana instance is automatically configured with a managed identity. The identity has the Monitoring Data Reader role assigned to it at the subscription level. This role allows the identity to read any monitoring data for the subscription. This identity is used to authenticate Grafana to Azure Monitor. You don't need to do anything to configure the identity.

Create the Prometheus data source in Grafana

To configure Prometheus as a data source, follow these steps:

  1. Open your Azure Managed Grafana workspace in the Azure portal.

  2. Select the endpoint to view the Grafana workspace.

  3. Select Connections > Data sources.

  4. Select Add data source.

  5. Search for and select Prometheus.

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

  7. Under Authentication, select Azure Auth.

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

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

    Screenshot that shows configuration for Prometheus data source.

Frequently asked questions

This section provides answers to common questions.

I'm missing all or some of my metrics. How can I troubleshoot?

Use the Troubleshooting guide to learn how to ingest Prometheus metrics from the managed agent.

Why am I missing metrics that have two labels with the same name but different casing?

Azure Managed Prometheus is a case-insensitive system. It treats strings, such as metric names, label names, or label values, as the same time series if they differ from another time series only by the case of the string. For more information, see Prometheus metrics overview.

I see some gaps in metric data. Why is this behavior occurring?

During node updates, you might see a one-minute to two-minute gap in metric data for metrics collected from our cluster-level collectors. This gap occurs because the node that the data runs on is being updated as part of a normal update process. This update process affects cluster-wide targets such as kube-state-metrics and custom application targets that are specified. This process occurs when your cluster is updated manually or via automatic update.

This behavior is expected and doesn't affect any of our recommended alert rules.