|
| 1 | +--- |
| 2 | +title: Metrics explorer for Azure monitor workspace (Preview) |
| 3 | +description: Learn about Metrics Explorer for Azure monitor workspace, a tool in that allows you to analyze and visualize metrics stored in an Azure monitor worksapce. |
| 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 | + |
| 12 | +# Metrics explorer for Azure monitor workspace (Preview) |
| 13 | + |
| 14 | +Metrics Explorer for Azure Monitor workspace (Preview) is allows you to analyze and visualize metrics stored in an Azure Monitor workspace. You can use the metrics explorer to create and customize charts, and to analyze and troubleshoot issues with your resources. The metrics explorer supports Prometheus query language (PromQL), allowing you to query and visualize metrics data in a flexible and powerful way. For more information on PromQL, see [Querying Prometheus](https://prometheus.io/docs/prometheus/latest/querying/basics/). |
| 15 | + |
| 16 | + |
| 17 | +## Create a Chart using Metrics Explorer for Azure Monitor workspace (Preview) |
| 18 | + |
| 19 | +Metrics explorer for Azure Monitor workspace (Preview) is available from the **Metrics** blade of the Azure monitor workspace in the Azure portal. The **New chart** pane opens on the right side of the screen. |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +The chart pane has two options for charting a metric: |
| 24 | +- Add with builder |
| 25 | +- Add with editor. |
| 26 | + |
| 27 | +To add a metric with the builder, select **Add metric** and select **Add with builder**. Use the toolbar to select a scope and metric from the drop-down lists. The scope is the azure monitor workspace where the metric is stored. The metric is displayed by default as a line chart the 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. You can also add |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +:::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." ::: |
| 32 | + |
| 33 | + |
| 34 | +To add a metric using the editor, select **Add metric** and select **Add with editor**. Use select a scope form the dropdown list and in the editor field, enter a PromQL query to retrieve metrics data. 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. |
| 35 | + |
| 36 | +:::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." ::: |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | +## Muliple Metrics and charts |
| 42 | +Add multiple metrics to the chart by selecting **Add metric**. Use either the builder or the editor to add metrics to the chart. |
| 43 | +You can add up to <<<<<<<10>>>>>>> metrics to a chart. Each metric and query is plotted on the chart and added to the legend. You can choose a different scope for each metric by selecting the scope dropdown list in the toolbar to compare metrics from different resources. |
| 44 | + |
| 45 | +> [!NOTE] |
| 46 | +> Running both the code editor and query builder on the same chart is not supported in this current release and may result in unexpected behavior. |
| 47 | +
|
| 48 | +You can create additional charts by selecting **New chart**. Each chart can have multiple metrics. |
| 49 | +Each chart can have multiple metrics, different chart types and settings. The time range is common for all the charts in the workspace. |
| 50 | + |
| 51 | +To remove a chart select the **...** options menu and select **Remove**. |
| 52 | +:::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."::: |
| 53 | + |
| 54 | +## Configure the time range |
| 55 | +The time picker lets you configure the time range 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. |
| 56 | + |
| 57 | +Set the time range for the chart by selecting the time range dropdown list in the toolbar. |
| 58 | + |
| 59 | +:::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." ::: |
| 60 | + |
| 61 | +## Pan across metrics data |
| 62 | + |
| 63 | +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. |
| 64 | + |
| 65 | +:::image type="content" source="./media/metrics-explorer/pan-time-axis.gif" lightbox="./media/metrics-explorer/pan-time-axis.gif" alt-text="A screeshot showing panning across the time axis."::: |
| 66 | + |
| 67 | + |
| 68 | +## Zoom into metrics data |
| 69 | + |
| 70 | +You can configure the time granularity of the chart data to support zoom in and zoom out for the time range. Use the time brush to investigate an interesting area of the chart like a spike or a dip in the data. Select an area on the chart and the chart zooms in to show more detail for the selected area based on your granularity settings. If the time grain is set to Automatic, zooming selects a smaller time grain. The new time range applies to all charts in metrics explorer. |
| 71 | + |
| 72 | + |
| 73 | +:::image type="content" source="./media/metrics-explorer/zoom-in-time.gif" lightbox="./media/metrics-explorer//zoom-in-time.gif" alt-text="A screeshot showing zooming in on the time axis."::: |
| 74 | + |
| 75 | + |
| 76 | +# Supported PromQL funtions |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | +cluster (ci-prod-aks-mac-weu) -- |
| 84 | + |
| 85 | +sum( |
| 86 | + container_memory_working_set_bytes{job="cadvisor", cluster="ci-prod-aks-mac-weu", namespace="kube-system", container!="", image!=""} |
| 87 | + * on(namespace,pod) |
| 88 | + group_left(workload, workload_type) namespace_workload_pod:kube_pod_owner:relabel{cluster="ci-prod-aks-mac-weu", namespace="kube-system", workload_type="deployment"} |
| 89 | +) by (workload, workload_type) |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +IS there a limit to the numner of metrics on a chart ? |
0 commit comments