您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

Azure 指标资源管理器入门Getting started with Azure Metrics Explorer

从哪里开始Where do I start

Azure Monitor 指标资源管理器是 Microsoft Azure 门户的一个组件,通过它可以绘制图表、以直观的形式关联趋势及研究指标值的上升和下降。Azure Monitor metrics explorer is a component of the Microsoft Azure portal that allows plotting charts, visually correlating trends, and investigating spikes and dips in metrics' values. 使用指标资源管理器调查资源的运行状况和利用率。Use the metrics explorer to investigate the health and utilization of your resources. 请按以下顺序开始:Start in the following order:

  1. 选取资源和指标并查看基本图表。Pick a resource and a metric and you see a basic chart. 然后选择与调查相关的时间范围Then select a time range that is relevant for your investigation.

  2. 尝试应用维度筛选器和拆分Try applying dimension filters and splitting. 使用筛选器和拆分可以分析哪些指标段影响了整体指标值,以及识别可能的离群值。The filters and splitting allow you to analyze which segments of the metric contribute to the overall metric value and identify possible outliers.

  3. 在将图表固定到仪表板之前使用高级设置对其进行自定义。Use advanced settings to customize the chart before pinning to dashboards. 配置警报,以便在指标值超过阈值或降到阈值以下时收到通知。Configure alerts to receive notifications when the metric value exceeds or drops below a threshold.

创建第一个指标图表Create your first metric chart

若要在资源、资源组、订阅或 Azure Monitor 视图中创建指标图表,请打开“指标”选项卡并执行以下步骤: To create a metric chart, from your resource, resource group, subscription, or Azure Monitor view, open the Metrics tab and follow these steps:

  1. 使用资源选取器选择要查看其指标的资源。Using the resource picker, select the resource for which you want to see metrics. (如果已在特定资源的上下文中打开了“指标”,则系统已预先选择该资源)。 (The resource is pre-selected if you opened Metrics in the context of a specific resource).

    选择资源

  2. 对于某些资源,必须选取一个命名空间。For some resources, you must pick a namespace. 命名空间只是一种为了轻松查找指标而组织指标的方式。The namespace is just a way to organize metrics so that you can easily find them. 例如,存储帐户具有单独的命名空间,用于存储文件、表、Blob 和队列指标。For example, storage accounts have separate namespaces for storing Files, Tables, Blobs, and Queues metrics. 许多资源类型只有一个命名空间。Many resource types only have one namespace.

  3. 从可用指标列表中选择一个指标。Select a metric from a list of available metrics.

    选择指标

  4. (可选)可以更改指标聚合Optionally, you can change the metric aggregation. 例如,你可能希望图表显示指标的最小值、最大值或平均值。For example, you might want your chart to show minimum, maximum, or average values of the metric.

提示

如果要查看在同一图表中绘制的多个指标,请使用“添加指标”按钮,并重复这些步骤 。Use the Add metric button and repeat these steps if you want to see multiple metrics plotted in the same chart. 若要在一个视图中添加多个图表,请选择顶部的“添加图表”按钮。 For multiple charts in one view, select the Add chart button on top.

选择时间范围Select a time range

警告

Azure 中的大多数指标将存储 93 天Most metrics in Azure are stored for 93 days. 不过,您可以在任何一个图表上查询30天以上的数据。However, you can query no more than 30 days worth of data on any single chart. 此限制不适用于基于日志的指标This limitation doesn't apply to log-based metrics.

默认情况下,图表显示最近 24 小时内的指标数据。By default, the chart shows the most recent 24 hours of metrics data. 使用“时间选取器”面板可更改时间范围,以及放大或缩小图表。 Use the time picker panel to change the time range, zoom in, or zoom out on your chart.

更改时间范围面板

提示

使用时间画笔调查图表中感兴趣的区域(高峰或低谷)。Use the time brush to investigate an interesting area of the chart (spike or a dip). 将鼠标指针放在区域的开始处,单击并按住鼠标左键,拖动到区域的另一侧,然后松开按钮。Put the mouse pointer at the beginning of the area, click and hold the left mouse button, drag to the other side of area and then release the button. 图表将在该时间范围内放大。The chart will zoom in on that time range.

应用维度筛选器和拆分Apply dimension filters and splitting

筛选拆分是用于处理包含维度的指标的强大诊断工具。Filtering and splitting are powerful diagnostic tools for the metrics that have dimensions. 这些功能会显示各种指标段(“维度值”)如何影响指标的整体值,并让你识别可能的离群值。These features show how various metric segments ("dimension values") impact the overall value of the metric, and allow you to identify possible outliers.

  • 通过筛选可以选择要包含在图表中的维度值。Filtering lets you choose which dimension values are included in the chart. 例如,在绘制“服务器响应时间”指标的图表时,你可能想要成功的请求。 For example, you might want to show successful requests when charting the server response time metric. 需要对“请求成功”维度应用筛选器。 You would need to apply the filter on the success of request dimension.

  • 拆分可以控制图表是针对维度的每个值显示单独行,还是将值聚合为一行。Splitting controls whether the chart displays separate lines for each value of a dimension, or aggregates the values into a single line. 例如,可以在一行中查看所有服务器实例的平均响应时间,也可以在不同的行中查看每台服务器的此项指标。For example, you can see one line for an average response time across all server instances, or see separate lines for each server. 需要对“服务器实例”维度应用拆分才能查看单独的行。 You would need to apply splitting on the server instance dimension to see separate lines.

请参阅应用了筛选和拆分的图表示例See examples of the charts that have filtering and splitting applied. 本文介绍了用于配置图表的步骤。The article shows the steps were used to configure the charts.

高级图表设置Advanced chart settings

可以自定义图表样式和标题并修改高级图表设置。You can customize chart style, title, and modify advanced chart settings. 完成自定义后,将其固定到仪表板以保存工作。When done with customization, pin it to a dashboard to save your work. 你还可以配置指标警报。You can also configure metrics alerts. 请参阅产品文档来了解 Azure Monitor 指标资源管理器的上述功能和其他高级功能。Follow product documentation to learn about these and other advanced features of Azure Monitor metrics explorer.

后续步骤Next steps