Skip to content

Commit 2e6e557

Browse files
authored
Merge pull request #270752 from EdB-MSFT/new-metrics-explorer
New metrics explorer for AMW
2 parents 1e41fb9 + f8b3312 commit 2e6e557

9 files changed

+137
-3
lines changed

articles/azure-monitor/essentials/analyze-metrics.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ Watch the following video for an overview of creating and working with metrics c
2121

2222
> [!VIDEO https://www.microsoft.com/videoplayer/embed/RE4qO59]
2323
24+
## Create a metric chart using PromQL
25+
26+
You can now create charts using Prometheus query language (PromQL) for metrics stored in an Azure Monitor workspace. For more information, see [Metrics explorer with PromQL (Preview)](./metrics-explorer.md).
27+
2428
## Create a metric chart
2529

2630
You can open metrics explorer from the **Azure Monitor overview** page, or from the **Monitoring** section of any resource. In the Azure portal, select **Metrics**.
@@ -116,6 +120,8 @@ Use the time picker to change the **Time range** for your data, such as the last
116120

117121
In addition to changing the time range with the time picker, you can pan and zoom by using the controls in the chart area.
118122

123+
## Interactive chart features
124+
119125
### Pan across metrics data
120126

121127
To pan, select the left and right arrows at the edge of the chart. The arrow control moves the selected time range back and forward by one half of the chart's time span. If you're viewing the past 24 hours, selecting the left arrow causes the time range to shift to span a day and a half to 12 hours ago.
134 KB
Loading
155 KB
Loading
123 KB
Loading
109 KB
Loading
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
title: Azure Monitor metrics explorer with PromQL (Preview)
3+
description: Learn about Azure Monitor metrics explorer with Prometheus query language support.
4+
author: EdB-MSFT
5+
ms.service: azure-monitor
6+
ms-author: edbaynash
7+
ms.topic: conceptual
8+
ms.date: 04/01/2024
9+
ms.reviewer: priyamishra
10+
11+
# Customer intent: As an Azure Monitor user, I want to learn how to use Azure Monitor metrics explorer with PromQL.
12+
13+
---
14+
15+
# Azure Monitor metrics explorer with PromQL (Preview)
16+
17+
Azure Monitor metrics explorer with PromQL (Preview) allows you to analyze metrics using Prometheus query language (PromQL) for metrics stored in an Azure Monitor workspace.
18+
19+
Azure Monitor metrics explorer with PromQL (Preview) is available from the **Metrics** menu item of any Azure Monitor workspace. You can query metrics from form Azure Monitor workspaces using PromQL or any other Azure resource using the query builder.
20+
21+
> [!NOTE]
22+
> You must have the *Monitoring Reader* role at the subscription level to visualize metrics across multiple resources, resource groups, or a subscription. For more information, see [Assign Azure roles in the Azure portal](/azure/role-based-access-control/role-assignments-portal).
23+
24+
25+
## Create a chart
26+
27+
The chart pane has two options for charting a metric:
28+
- Add with editor.
29+
- Add with builder.
30+
31+
Adding a chart with the editor allows you to enter a PromQL query to retrieve metrics data. The editor provides syntax highlighting and intellisense for PromQL queries. Currently, queries are limited to the metrics stored in an Azure Monitor workspace. For more information on PromQL, see [Querying Prometheus](https://prometheus.io/docs/prometheus/latest/querying/basics/).
32+
33+
34+
Adding a chart with the builder allows you to select metrics from any of your Azure resources. The builder provides a list of metrics available in the selected scope. Select the metric, aggregation type, and chart type from the builder. The builder can't be used to chart metrics stored in an Azure Monitor workspace.
35+
36+
37+
### Create a chart with the editor and PromQL
38+
39+
To add a metric using the query editor:
40+
41+
1. Select **Add metric** and select **Add with editor** from the dropdown.
42+
43+
1. Select a **Scope** from the dropdown list. This scope is the Azure Monitor workspace where the metrics are stored.
44+
1. Enter a PromQL query in the editor field, or select a single metric from **Metric** dropdown.
45+
1. Select **Run** to run the query and display the results in the chart. You can customize the chart by selecting the gear-wheel icon. You can change the chart title, add annotations, and set the time range for the chart.
46+
47+
:::image type="content" source="./media/metrics-explorer/add-metric-with-editor.png" lightbox="./media/metrics-explorer/add-metric-with-editor.png" alt-text="A screenshot showing adding a metric using the editor." :::
48+
49+
### Create a chart with the builder
50+
51+
To add a metric with the builder:
52+
53+
1. Select **Add metric** and select **Add with builder** from the dropdown.
54+
55+
1. Select a **Scope**. The scope can be any Azure resource in your subscription.
56+
1. Select a **Metric Namespace** from the dropdown list. The metrics namespace is the category of the metric.
57+
1. Select a **Metric** from the dropdown list.
58+
1. Select the **Aggregation** type from the dropdown list.
59+
60+
For more information on the selecting scope, metrics, and aggregation, see [Analyze metrics](/azure/azure-monitor/essentials/analyze-metrics#set-the-resource-scope).
61+
62+
:::image type="content" source="./media/metrics-explorer/add-metric-with-builder.png" lightbox="./media/metrics-explorer/add-metric-with-builder.png" alt-text="A screenshot showing adding a metric using the builder in the metrics explorer." :::
63+
64+
Metrics are displayed by default as a line chart. Select your preferred chart type from the dropdown list in the toolbar. Customize the chart by selecting the gear-wheel icon. You can change the chart title, add annotations, and set the time range for the chart.
65+
66+
## Multiple metrics and charts
67+
Each workspace can host multiple charts. Each chart can contain multiple metrics.
68+
69+
### Add a metric
70+
71+
Add multiple metrics to the chart by selecting **Add metric**. Use either the builder or the editor to add metrics to the chart.
72+
73+
> [!NOTE]
74+
> Using both the code editor and query builder on the same chart is not supported in the Preview release of Azure Monitor metrics explorer and may result in unexpected behavior.
75+
76+
77+
### Add a new chart
78+
79+
Create additional charts by selecting **New chart**. Each chart can have multiple metrics and different chart types and settings.
80+
81+
Time range and granularity are applied to all the charts in the workspace.
82+
83+
:::image type="content" source="./media/metrics-explorer/create-multiple-charts.png" lightbox="./media/metrics-explorer/create-multiple-charts.png" alt-text="A screenshot showing multiple charts.":::
84+
85+
### Remove a chart
86+
87+
To remove a chart, select the ellipsis (**...**) options icon and select **Remove**.
88+
89+
## Configure time range and granularity
90+
91+
Configure the time range and granularity for your metric chart to view data that's relevant to your monitoring scenario. By default, the chart shows the most recent 24 hours of metrics data.
92+
93+
Set the time range for the chart by selecting the time picker in the toolbar. Select a predefined time range, or set a custom time range.
94+
95+
96+
Time grain is the frequency of sampling and display of the data points on the chart. Select the time granularity by using the time picker in the metrics explorer. If the data is stored at a lower or more frequent granularity than selected, the metric values displayed are aggregated to the level of granularity selected. The time grain is set to automatic by default. The automatic setting selects the best time grain based on the time range selected.
97+
98+
For more information on configuring time range and granularity, see [Analyze metrics](/azure/azure-monitor/essentials/analyze-metrics#configure-the-time-range).
99+
100+
:::image type="content" source="./media/metrics-explorer/time-picker.png" lightbox="./media/metrics-explorer/time-picker.png" alt-text="A screenshot showing time range picker." :::
101+
102+
## Chart features
103+
104+
Interact with the charts to gain deeper insights into your metrics data.
105+
Interactive features include the following:
106+
107+
- Zoom-in. Select and drag to zoom in on a specific area of the chart.
108+
- Pan. Shift chart left and right along the time axis.
109+
- Change chart settings such as chart type, Y-axis range, and legends.
110+
- Save and share charts
111+
112+
For more information on chart features, see [Interactive chart features](/azure/azure-monitor/essentials/analyze-metrics#interactive-chart-features).
113+
114+
115+
## Next steps
116+
117+
- [Azure Monitor managed service for Prometheus](/azure/azure-monitor/essentials/prometheus-metrics-overview)
118+
- [Azure Monitor workspace overview](/azure/azure-monitor/essentials/azure-monitor-workspace-overview)
119+
- [Understanding metrics aggregation](/azure/azure-monitor/essentials/metrics-aggregation-explained)

articles/azure-monitor/essentials/prometheus-metrics-overview.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.date: 01/25/2024
1010

1111
# Azure Monitor managed service for Prometheus
1212

13-
Azure Monitor managed service for Prometheus is a component of [Azure Monitor Metrics](data-platform-metrics.md), providing more flexibility in the types of metric data that you can collect and analyze with Azure Monitor. Prometheus metrics share some features with platform and custom metrics, but use some different features to better support open source tools such as [PromQL](https://aka.ms/azureprometheus-promio-promql) and [Grafana](../../managed-grafana/overview.md).
13+
Azure Monitor managed service for Prometheus is a component of [Azure Monitor Metrics](data-platform-metrics.md), providing more flexibility in the types of metric data that you can collect and analyze with Azure Monitor. Prometheus metrics are supported by analysis tool like [Azure Monitor Metrics Explorer with PromQL](./metrics-explorer.md) and open source tools such as [PromQL](https://aka.ms/azureprometheus-promio-promql) and [Grafana](../../managed-grafana/overview.md).
1414

1515
Azure Monitor managed service for Prometheus allows you to collect and analyze metrics at scale using a Prometheus-compatible monitoring solution, based on the [Prometheus](https://aka.ms/azureprometheus-promio) project from the Cloud Native Computing Foundation. This fully managed service allows you to use the [Prometheus query language (PromQL)](https://aka.ms/azureprometheus-promio-promql) to analyze and alert on the performance of monitored infrastructure and workloads without having to operate the underlying infrastructure.
1616

@@ -23,14 +23,20 @@ Azure Monitor managed service for Prometheus can currently collect data from any
2323
- Azure Kubernetes service (AKS)
2424
- Azure Arc-enabled Kubernetes
2525
- Any server or Kubernetes cluster running self-managed Prometheus using [remote-write](./remote-write-prometheus.md).
26+
- Virtual Machines and Virtual Machine Scale Sets configured for remote write to a Prometheus server.
2627

2728
## Enable
2829
The only requirement to enable Azure Monitor managed service for Prometheus is to create an [Azure Monitor workspace](azure-monitor-workspace-overview.md), which is where Prometheus metrics are stored. Once this workspace is created, you can onboard services that collect Prometheus metrics.
2930

3031
- To collect Prometheus metrics from your Kubernetes cluster, see [Enable monitoring for Kubernetes clusters](../containers/kubernetes-monitoring-enable.md#enable-prometheus-and-grafana).
3132
- To configure remote-write to collect data from your self-managed Prometheus server, see [Azure Monitor managed service for Prometheus remote write](./remote-write-prometheus.md).
3233

34+
## Azure Monitor Metrics Explorer with PromQL
35+
36+
Metrics Explorer with PromQL allows you to analyze and visualize platform metrics, and use Prometheus query language (PromQL) to query Prometheus and other metrics stored in an Azure Monitor workspace. Metrics Explorer with PromQL is available from the **Metrics** menu item of any Azure Monitor workspace in the Azure portal. See [Metrics Explorer with PromQL](./metrics-explorer.md) for more information.
37+
3338
## Grafana integration
39+
3440
The primary method for visualizing Prometheus metrics is [Azure Managed Grafana](../../managed-grafana/overview.md). [Connect your Azure Monitor workspace to a Grafana workspace](./azure-monitor-workspace-manage.md#link-a-grafana-workspace) so that it can be used as a data source in a Grafana dashboard. You then have access to multiple prebuilt dashboards that use Prometheus metrics and the ability to create any number of custom dashboards.
3541

3642
## Rules and alerts
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
ms.service: azure-monitor
33
ms.topic: include
4-
ms.date: 10/31/2023
4+
ms.date: 4/08/2024
55
ms.author: edbaynash
66
author: EdB-MSFT
77
---
88

99
### Can I view my Prometheus metrics in Azure Monitor metrics explorer?
1010

11-
Metrics explorer in Azure Monitor doesn't currently support visualizing Prometheus metric data. Consider using [Azure Managed Grafana](../../managed-grafana/index.yml) to visualize your Prometheus metrics.
11+
Metrics explorer with PromQL supports visualizing Prometheus metrics data using PromQL. To use the Metrics Explorer with PromQL support, select the **Metrics** menu item from any Azure Monitor workspace in the Azure portal. For more information, see [Metrics explorer with PromQL (Preview)](../essentials/metrics-explorer.md).

articles/azure-monitor/toc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,9 @@ items:
11711171
items:
11721172
- name: Analyze metrics
11731173
href: essentials/analyze-metrics.md
1174+
- name: Metrics explorer with PromQL
1175+
displayName: Prometheus, metrics explorer
1176+
href: essentials/metrics-explorer.md
11741177
- name: Understanding metrics aggregation
11751178
href: essentials/metrics-aggregation-explained.md
11761179
- name: Examples of metric charts

0 commit comments

Comments
 (0)