Edit

Share via


Azure Monitor and Prometheus

Prometheus is a popular open-source monitoring and alerting solution that's widely used in the cloud-native ecosystem. Azure Monitor provides a fully managed service for Prometheus that enables you to collect, store, and analyze Prometheus metrics without maintaining your own Prometheus server. You can leverage this managed service to collect Prometheus metrics from your Kubernetes clusters and virtual machines, or you can integrate with it from your self-managed Prometheus servers.

Azure Monitor managed service for Prometheus

Azure Monitor managed service for Prometheus provides a fully managed and scalable environment for running Prometheus. It simplifies the deployment, management, and scaling of Prometheus in AKS and Azure Arc-enabled Kubernetes so you can focus on monitoring your applications and infrastructure. As a fully managed service, it provides high availability, service-level agreement (SLA) guarantees, automatic software updates, and a highly scalable metrics store that retains data for up to 18 months.

Azure Monitor managed service for Prometheus provides preconfigured alerts, rules, and dashboards. It fully supports Prometheus Query Language (PromQL) and provides tools in the Azure portal for interactively querying and visualizing Prometheus metrics. With recommended dashboards from the Prometheus community and native Grafana integration, you can achieve comprehensive monitoring immediately. It integrates with Azure Managed Grafana, provides a seamless data source for Azure Monitor dashboards with Grafana (preview), and can also provide data for your existing self-managed Grafana environment.

Diagram showing overview of Managed Prometheus and Azure Monitor tools that use it.

Benefits of Azure Monitor managed service for Prometheus

Key benefits of Azure Monitor managed service for Prometheus include:

Pricing

There's no direct cost to Azure Monitor managed service for Prometheus or creating an Azure Monitor workspace. Pricing is based on ingestion and query of collected data. See the Metrics tab in Azure Monitor pricing for details.

Data collection

Azure Monitor managed service for Prometheus currently collects data directly from AKS and Azure Arc-enabled Kubernetes. Azure Monitor provides an onboarding process that installs the Azure Monitor agent in your cluster and creates a data collection rule (DCR) that defines the data collection process and directs the data to the appropriate workspace. You can use the Azure portal, CLI, PowerShell, and ARM/Bicep templates to easily enable and configure monitoring or work directly with ConfigMap and the DCR for more advanced scenarios.

See Enable monitoring for Kubernetes clusters for details on enabling Managed Prometheus on your cluster. To enable managed Prometheus for Microsoft Azure air-gapped clouds, contact support.

Data storage

The only requirement to enable Azure Monitor managed service for Prometheus is to create an Azure Monitor workspace which provides the storage for Prometheus metrics. Add Azure Monitor workspaces to separate data for different regions, environments, or teams. Onboarding for monitoring resources such as Azure Kubernetes Service (AKS) clusters guide you through the process of creating a new Azure Monitor workspace or connecting to an existing one. Data is stored for 18 months at no additional cost.

Integrate with self-managed Prometheus

Azure Monitor managed service for Prometheus is intended to be a replacement for self managed Prometheus so you don't need to manage a Prometheus server in your Kubernetes clusters. There may be scenarios though where you want to continue to use self-managed Prometheus in your Kubernetes clusters while also sending data to Managed Prometheus for long term data retention and to create a centralized view across your clusters. This may be a temporary solution while you migrate to Managed Prometheus or a long term solution if you have specific requirements to maintain your existing environment.

Remote_write is a feature in Prometheus that allows you to send metrics from a local Prometheus instance to remote storage or to another Prometheus instance. Use this feature to send metrics from self-managed Prometheus running in your Kubernetes cluster or virtual machines to an Azure Monitor workspace used by Managed Prometheus.

The following diagram illustrates this strategy. A data collection rule (DCR) in Azure Monitor provides an endpoint for the self-managed Prometheus to send metrics to and defines the Azure Monitor workspace where the data will be sent.

Diagram showing use of remote-write to send metrics from local Prometheus to Managed Prometheus.

See Connect self-managed Prometheus to Azure Monitor managed service for Prometheus to configure remote write to collect data from a self-managed Prometheus server.

Querying and analyzing Prometheus metrics

Azure Monitor provides multiple tools for querying and analyzing Prometheus metrics stored in an Azure Monitor workspace. You can write your own queries using PromQL, use queries from the open-source community, and use and create Grafana dashboards. The following table describes the tools available for querying and analyzing Prometheus metrics stored in an Azure Monitor workspace.

Tool Description
Container insights Container insights provides a variety of interactive views to analyze Prometheus metrics for your Kubernetes cluster. View high level metrics for your cluster or drill down to analyze detail metrics for the components of your cluster including nodes, controllers, and containers. See Analyze Kubernetes cluster data with Container insights.
Azure Monitor metrics explorer with PromQL Use metrics explorer with PromQL (preview) to analyze and visualize platform and Prometheus metrics in the Azure portal. See Azure Monitor metrics explorer with PromQL.
Azure Monitor workbooks Create charts and dashboards powered by Azure Monitor managed service for Prometheus by using Azure workbooks and PromQL queries. See Query Prometheus metrics using Azure workbooks.
Grafana Visualize Prometheus metrics using Grafana dashboards are a common solution to visualize Prometheus data, and a variety of community dashboards are available. Azure Monitor dashboards with Grafana (preview) provides a built-in experience at no cost. Use Azure Managed Grafana for dashboards combining different data sources. See Visualize with Grafana.
Prometheus query API Use PromQL with the REST API to query Prometheus metrics stored in an Azure Monitor workspace. For more information, see Query Prometheus metrics using the API and PromQL.

Rules and alerts

Recording rules in Prometheus allow you to precompute values stored in the time series, while alert rules provide proactive notification of predefined conditions in your collected metrics. Azure Monitor managed service for Prometheus automatically deploys a predefined set of recording rules, and Container insights allows you to easily enable a set of common alert rules for Kubernetes clusters.

Recording and alert rules are stored in the Azure Monitor workspace, and you can easily manage existing rules and manually create custom rules using a variety of methods such as the Azure portal, CLI, Bicep, and ARM. See Azure Monitor managed service for Prometheus rule groups for details.