Azure 計量瀏覽器的進階的功能Advanced features of Azure Metrics Explorer

注意

本文假設您已熟悉基本的計量瀏覽器的功能。This article assumes that you are familiar with basic features of Metrics Explorer. 如果您是新的使用者,而且想要了解如何建立您第一次的計量圖表,請參閱開始使用 Azure 計量瀏覽器If you are a new user and want to learn how to create your first metric chart, see Getting started with Azure Metrics Explorer.

Azure 中的計量Metrics in Azure

Azure 監視器中的計量是隨時間收集並儲存的一系列度量與計數值。Metrics in Azure Monitor are the series of measured values and counts that are collected and stored over time. 計量包括標準 (或稱為「平台」) 計量與自訂計量。There are standard (or “platform”) metrics, and custom metrics. 標準計量是由 Azure 平台本身提供給您使用。The standard metrics are provided to you by the Azure platform itself. 標準計量反映您 Azure 資源的健康情況與使用情形統計資料。Standard metrics reflect the health and usage statistics of your Azure resources. 而自訂計量時,會傳送至 Azure 上,使用的應用程式所自訂事件和度量的 Application Insights APIWindows Azure 診斷 (WAD) extension,或由Azure監視 REST APIWhereas custom metrics are sent to Azure by your applications using the Application Insights API for custom events and metrics, Windows Azure Diagnostics (WAD) extension, or by Azure Monitor REST API.

建立具有多個度量和圖表的檢視Create views with multiple metrics and charts

您可以建立圖表的繪製多個計量行或一次顯示多個度量的圖表。You can create charts that plot multiple metrics lines or show multiple metric charts at once. 這項功能可讓您:This functionality allows you to:

  • 在相同的圖形,請參閱如何一個值上相互關聯相關的度量資訊與另一個correlate related metrics on the same graph to see how one value is related to another
  • 顯示具有不同非常接近的測量單位的度量display metrics with different units of measure in close proximity
  • 以視覺化方式彙總並比較多個資源的計量visually aggregate and compare metrics from multiple resources

例如,如果您有 5 個儲存體帳戶,而且您想要知道多少總空間用完其間,您可以建立 (堆疊) 區域圖會顯示所有值的總和與個人在特定時間點的時間。For example, if you have 5 storage accounts and you want to know how much total space is consumed between them, you can create a (stacked) area chart which shows the individual and sum of all the values at particular points in time.

在相同圖表上的多個計量Multiple metrics on the same chart

首先,建立新的圖表First, create a new chart. 按一下 新增計量重複步驟,在相同圖表上新增其他計量。Click Add Metric and repeat the steps to add another metric on the same chart.

注意

您一般不會想要有具有不同計量單位的計量 (例如「毫秒」與 “KB”) 或其刻度在單一圖表上會呈現大幅差異的計量。You typically don’t want to have metrics with different units of measure (i.e. “milliseconds” and “kilobytes”) or with significantly different scale on one chart. 如果是這樣,您應該考慮使用多個圖表。Instead, consider using multiple charts. 按一下 [新增圖表] 按鈕以在計量瀏覽器中建立多個圖表。Click on the Add Chart button to create multiple charts in metrics explorer.

多個圖表Multiple charts

按一下 新增圖表,並使用不同的計量建立另一個圖表。Click the Add chart and create another chart with a different metric.

排列或刪除多個圖表Order or delete multiple charts

若要排序或刪除多個圖表,請按一下省略符號 ( ... ) 符號以開啟 [圖表] 功能表,然後選擇適當的功能表項目向上移動下移,或刪除To order or delete multiple charts, click on the ellipses ( ... ) symbol to open the chart menu and choose the appropriate menu item of Move up, Move down, or Delete.

將篩選條件套用至圖表Apply filters to charts

您可以將篩選器套用到以多個維度顯示計量的圖表。You can apply filters to the charts that show metrics with dimensions. 例如,若「交易計數」計量有「回應類型」維度 (指出來自交易的回應成功或失敗),則在此維度上篩選將只為成功 (或失敗) 的交易繪製圖表線條。For example, if the metric “Transaction count” has a dimension, “Response type”, which indicates whether the response from transactions succeeded or failed then filtering on this dimension would plot a chart line for only successful (or only failed) transactions.

加入篩選條件To add a filter

  1. 選取圖表上方的 [新增篩選器] Select Add filter above the chart

  2. 選取您要篩選的維度 (屬性)Select which dimension (property) you want to filter

    計量影像

  3. 選取當繪製圖表時要包括的維度值 (此範例會顯示篩選出成功的交易):Select which dimension values you want to include when plotting the chart (this example shows filtering out the successful storage transactions):

    計量影像

  4. 選取篩選器值之後,請按一下 [篩選器選取器] 以外的位置以將它關閉。After selecting the filter values, click away from the Filter Selector to close it. 現在圖表會顯示失敗的儲存體交易數目:Now the chart shows how many storage transactions have failed:

    計量影像

  5. 您可以重複步驟 1-4 以將多個篩選器套用到相同的圖表。You can repeat steps 1-4 to apply multiple filters to the same charts.

套用至圖表分割Apply splitting to a chart

您可以依維度來分割計量,以視覺化方式顯示維度的各區段與彼此之間的差異,並識別維度中與其他區段差異較大的區段。You can split a metric by dimension to visualize how different segments of the metric compare against each other, and identify the outlying segments of a dimension.

套用分割Apply splitting

  1. 按一下圖表上方的 [套用分割] 。Click on Apply splitting above the chart.

    注意

    分割不能有多個度量的圖表。Splitting cannot be used with charts that have multiple metrics. 此外,您可以有多個篩選器,但只有一個分割的維度,套用至任何單一的圖表。Also, you can have multiple filters but only one splitting dimension applied to any single chart.

  2. 選擇要據以將圖表分割為不同區段的維度:Choose a dimension on which you want to segment your chart:

    計量影像

    現在圖表會顯示多行,每個維度區段一行:Now the chart now shows multiple lines, one for each segment of dimension:

    計量影像

  3. 按一下 [分組選取器] 以外的位置以將它關閉。Click away from the Grouping Selector to close it.

    注意

    在相同維度上同時使用篩選與分割,以隱藏與您的案例不相關的區段,讓圖表更容易閱讀。Use both Filtering and Splitting on the same dimension to hide the segments that are irrelevant for your scenario and make charts easier to read.

鎖定圖表 y 軸的界限Lock boundaries of chart y-axis

圖表顯示的較大值的小波動時,鎖定 y 軸的範圍相當重要。Locking the range of the y-axis becomes important when the chart shows smaller fluctuations of larger values.

例如,成功要求的數量從 99.99% 下降到 99.5% 時,可能代表服務的品質大幅降低。For example, when the volume of successful requests drops down from 99.99% to 99.5%, it may represent a significant reduction in the quality of service. 不過,或許很難甚至無法從預設圖表設定注意到數值的小波動。However, noticing a small numeric value fluctuation would be difficult or even impossible from the default chart settings. 在此情況下,您可以將圖表的最低的界限鎖定為 99%,使得這種小幅度下降變得更明顯。In this case you could lock the lowest boundary of the chart to 99%, which would make this small drop more apparent.

另一個範例是可用記憶體的波動,在技術上,值永遠不會變成 0。Another example is a fluctuation in the available memory, where the value will technically never reach 0. 將範圍修正為較高的值可以更明顯發現可用記憶體減少。Fixing the range to a higher value may make the drops in available memory easier to spot.

若要控制 y 軸範圍,請使用 [...]To control the y-axis range, use the “…” 圖表功能表,然後選取編輯圖表存取進階圖表設定。chart menu, and select Edit chart to access advanced chart settings. 修改 [y 軸範圍] 區段中的值,或使用自動按鈕還原為預設值。Modify the values in the Y-Axis Range section, or use Auto button to revert to defaults.

計量影像

警告

鎖定圖表的 y 軸界限可追蹤一段時間的各種計算或加總,因此 (使用計數、加總、最小或最大彙總) 通常需要指定固定時間細微性,而不依賴自動預設值。Locking the boundaries of y-axis for the charts that track various counts or sums over a period of time (and thus use count, sum, minimum, or maximum aggregations) usually requires specifying a fixed time granularity rather than relying on the automatic defaults. 因為使用者調整瀏覽器視窗的大小,或從一個螢幕解析度變換為另一個螢幕解析度時,時間細微性經過修改,會導致圖表上的值變更,因此這有其必要性。This is necessary is because the values on charts change when the time granularity is automatically modified by the user resizing browser window or going from one screen resolution to another. 時間細微性中產生的變更會影響圖表的外觀,導致目前選取的 y 軸範圍無效。The resulting change in time granularity effects the look of the chart, invalidating current selection of y-axis range.

將圖表釘選到儀表板Pin charts to dashboards

設定圖表之後,您可以將它加入到儀表板,以便您可以在其他監視遙測情況下重新檢視它,或與您的小組共用。After configuring the charts, you may want to add it to the dashboards so that you can view it again, possibly in context of other monitoring telemetry, or share with your team.

將已設定的圖表釘選到儀表板:To pin a configured chart to a dashboard:

設定您的圖表之後,按一下圖表右上角的 [圖表動作] 功能表,然後按一下 [釘選到儀表板] 。After configuring your chart, click on the Chart Actions menu in the right top corner of the chart, and click Pin to dashboard.

計量影像

建立警示規則Create alert rules

您可以使用已設定的準則來將計量視覺化,以作為計量型警示規則的基礎。You can use the criteria you have set to visualize your metrics as the basis of a metric based alert rule. 新的警示規則將包含來自您圖表的目標資源、計量、分割及篩選維度。The new alerting rule will include your target resource, metric, splitting, and filter dimensions from your chart. 您稍後將能在警示規則建立窗格上修改這些設定。You will be able to modify these settings later on the alert rule creation pane.

若要建立新的警示規則,請按一下 [新增警示規則] To create a new alert rule, click New Alert rule

以紅色強調顯示的[新增警示規則] 按鈕

您將會進入警示規則建立窗格,其中已預先填入來自圖表的基礎計量維度,讓您能夠更輕鬆地產生自訂警示規則。You will be taken to the alert rule creation pane with the underlying metric dimensions from your chart pre-populated to make it easier to generate custom alert rules.

建立警示規則

若要深入了解如何設定計量警示,請查看這篇文章Check out this article to learn more about setting up metric alerts.

疑難排解Troubleshooting

我看不到我的圖表上的任何資料。I don't see any data on my chart.

  • 篩選會套用至窗格上的所有圖表。Filters apply to all the charts on the pane. 請確定,當您將焦點放在某個圖表時,您未在其他圖表上設定會排除所有資料的篩選。Make sure that, while you're focusing on one chart, you didn't set a filter that excludes all the data on another.

  • 如果您想要在不同的圖表上設定不同的篩選,請在不同的刀鋒視窗中建立圖表,將它們儲存為個別的最愛圖表。If you want to set different filters on different charts, create them in different blades, save them as separate favorites. 如果想要,您可以將這些圖表釘選到儀表板,以便並排查看兩者。If you want, you can pin them to the dashboard so that you can see them alongside each other.

  • 如果您依據計量上未定義的屬性區分圖表,則圖表上不會有任何資料。If you segment a chart by a property that is not defined on the metric, then there will be nothing on the chart. 請嘗試清除分割 (分割),或選擇不同的屬性。Try clearing the segmentation (splitting), or choose a different property.

後續步驟Next steps

閱讀建立自訂 KPI 儀表板以了解使用計量建立可採取動作之儀表板的最佳做法。Read Creating custom KPI dashboards to learn about the best practices for creating actionable dashboards with metrics.