监视媒体服务指标Monitor Media Services metrics

媒体服务徽标 v3media services logo v3


可以通过 Azure Monitor 监视指标和诊断日志,以便了解应用程序的执行情况。Azure Monitor enables you to monitor metrics and diagnostic logs that help you understand how your applications are performing. 有关此功能的详细说明以及应使用 Azure 媒体服务指标和诊断日志的原因,请参阅监视媒体服务指标和诊断日志For a detailed description of this feature and to understand why you should use Azure Media Services metrics and diagnostics logs, see Monitor Media Services metrics and diagnostic logs.

Azure Monitor 提供多种方式来与指标交互,包括在门户中制作指标图表、通过 REST API 访问指标,或者使用 Azure CLI 查询指标。Azure Monitor provides several ways to interact with metrics, including charting them in the portal, accessing them through the REST API, or querying them using Azure CLI. 本文介绍如何使用 Azure 门户图表和 Azure CLI 监视指标。This article shows how to monitor metrics with the Azure portal charts and Azure CLI.

必备条件Prerequisites

在 Azure 门户中查看指标View metrics in Azure portal

  1. 通过 https://portal.azure.cn 登录到 Azure 门户。Sign in to the Azure portal at https://portal.azure.cn.

  2. 导航到你的 Azure 媒体服务帐户,选择“指标”。 Navigate to your Azure Media Services account and select Metrics.

  3. 单击“范围”框,然后选择要监视的资源。Click the Scope box and select the resource you want to monitor.

    右侧会显示“选择范围”窗口,其中提供了可用资源的列表。The Select a scope window appears on the right with the list of resources available to you. 在本例中,你会看到:In this case you see:

    • <媒体服务帐户名称><Media Services account name>
    • <媒体服务帐户名称>/<流式处理终结点名称><Media Services account name>/<streaming endpoint name>
    • <存储帐户名称><storage account name>

    筛选,然后选择资源并按“应用”。Filter then select the resource and press Apply. 有关支持的资源和指标的详细信息,请参阅监视媒体服务指标For details about supported resources and metrics, see Monitor Media Services metrics.

    备注

    若要在你要监视的资源之间切换,请再次单击“源”框,然后重复上述步骤。To switch between resources you want to monitor, click on the Source box again and repeat this step.

  4. (可选)为图表命名(按顶部的铅笔图标来编辑名称)。Optional: give your chart a name (edit the name by pressing the pencil at the top).

  5. 添加想要查看的指标。Add the metrics that you want to view.

  6. 可将图表固定到仪表板。You can pin your chart to your dashboard.

使用 Azure CLI 查看指标View metrics with Azure CLI

若要使用 Azure CLI 获取“出口”指标,请运行以下 az monitor metrics 命令:To get "Egress" metrics with Azure CLI, you would run the following az monitor metrics command:

az monitor metrics list --resource \
   "/subscriptions/<subscription id>/resourcegroups/<resource group name>/providers/Microsoft.Media/mediaservices/<Media Services account name>/streamingendpoints/<streaming endpoint name>" \
   --metric "Egress"

若要获取其他指标,请将“传出”替换为所需的指标名称。To get other metrics, substitute "Egress" for the metric name you are interested in.

另请参阅See also

后续步骤Next steps

诊断日志Diagnostic logs