Azure Stack 中的 Azure MonitorAzure Monitor on Azure Stack

适用于:Azure Stack 集成系统Applies to: Azure Stack integrated systems

本文概述了 Azure Stack 中的 Azure Monitor 服务。This article provides an overview of the Azure Monitor service in Azure Stack. 它讨论了 Azure Monitor 的运行以及有关如何使用 Azure Stack 中的 Azure Monitor 的其他信息。It discusses the operation of Azure Monitor and additional information on how to use Azure Monitor on Azure Stack.

有关 Azure Monitor 的介绍、概述以及如何开始使用它的信息,请参阅 Azure 文章:Azure Stack 上的 Azure Monitor 入门For an introduction, overview, and how to get started with Azure Monitor, see the Azure article Get started with Azure Monitor on Azure Stack.

Azure Stack Monitor 边栏选项卡

Azure Monitor 是一项平台服务,可提供单个源用于监视 Azure 资源。Azure Monitor is the platform service that provides a single source for monitoring Azure resources. 通过 Azure Monitor,可直观显示、查询、路由和存档来自 Azure 内部资源的指标和日志并对其采取其他操作。With Azure Monitor, you can visualize, query, route, archive, and otherwise take action on the metrics and logs coming from resources in Azure. 可以通过使用 Azure Stack 管理门户、Monitor PowerShell Cmdlet、跨平台 CLI 或 Azure Monitor REST API 来处理此数据。You can work with this data by using the Azure Stack admin portal, Monitor PowerShell Cmdlets, Cross-Platform CLI, or Azure Monitor REST APIs. 有关 Azure Stack 支持的具体连接,请参阅如何使用 Azure Stack 中的监视数据For the specific connectivity supported by Azure Stack, see How to consume monitoring data from Azure Stack


指标和诊断日志不可用于 Azure Stack 开发工具包。Metrics and diagnostic logs are not available for the Azure Stack Development Kit.

Azure Stack 上的 Azure Monitor 的先决条件Prerequisites for Azure Monitor on Azure Stack

在你的订阅的套餐资源提供程序设置上注册 Microsoft.insights 资源提供程序。Register the Microsoft.insights resource provider on your subscription's offer resource providers settings. 你可以验证该资源提供程序在与你的订阅关联的套餐中是否可用:You can verify that the resource provider is available in your offer associated with your subscription:

  1. 打开 Azure Stack 管理门户。Open the Azure Stack admin portal.
  2. 选择“套餐”。Select Offers.
  3. 选择与订阅关联的套餐。Select the offer associated with the subscription.
  4. 在“设置”下,选择“资源提供程序”。Select Resource providers under Settings.
  5. 在列表中找到 Microsoft.Insights,并验证状态是否为“已注册”。Find Microsoft.Insights in the list and verify that the status is Registered..

Azure Stack 上的 Azure Monitor 概述Overview of Azure Monitor on Azure Stack

与 Azure 上的 Azure Monitor 一样,Azure Stack 上的 Azure Monitor 针对大多数服务提供基本级别的基础结构指标和日志。Like Azure Monitor on Azure, Azure Monitor on Azure Stack provides base-level infrastructure metrics and logs for most services.

Azure Monitor 源:计算子集Azure Monitor sources: compute subset

Azure Stack 上的 Azure Monitor 源 - 计算子集

Azure Stack 中的 Microsoft.Compute 资源提供程序包括:The Microsoft.Compute resource provider in Azure Stack includes:

  • 虚拟机Virtual Machines
  • 虚拟机规模集Virtual Machines scale sets

应用程序 - 诊断日志、应用程序日志和指标Application - Diagnostics logs, Application logs, and Metrics

应用程序可以在运行有 Microsoft.Compute 资源提供程序的 VM 的 OS 中运行。Applications can run in the OS of a VM running with the Microsoft.Compute resource provider. 这些应用程序和 VM 会发布其自己的日志和指标集。These applications and VMs emit their own set of logs and metrics. Azure Monitor 依赖于 Azure 诊断扩展(Windows 或 Linux)来收集大多数应用程序级指标和日志。Azure Monitor relies on the Azure diagnostics extension (Windows or Linux) to collect most application level metrics and logs.

度量值的类型包括:The types of measures include:

  • 性能计数器Performance counters
  • 应用程序日志Application logs
  • Windows 事件日志Windows event logs
  • .NET 事件源.NET event source
  • IIS 日志IIS logs
  • 基于清单的 ETWManifest-based ETW
  • 故障转储Crash dumps
  • 客户错误日志Customer error logs


Azure Stack 上的 Linux 诊断扩展不受支持。Linux Diagnostics extension on Azure Stack are not supported.

宿主和来宾 VM 指标Host and Guest VM metrics

前面列出的计算资源具有专用的宿主 VM 和来宾 OS。The previously listed compute resources have a dedicated host VM and guest OS. 宿主 VM 和来宾 OS 是 Hyper-V 虚拟机监控程序中的根 VM 和来宾 VM 的等效项。The host VM and guest OS are the equivalent of root VM and guest VM in Hyper-V hypervisor. 可以收集宿主 VM 和来宾 OS 的指标。You can collect metrics for both the host VM and the guest OS. 此外,还可以收集来宾 OS 的诊断日志。In addition, you can collect diagnostics logs for the guest OS. Azure Stack 上的 Azure Monitor 支持的指标中列出了 Azure Stack 上的宿主和来宾 VM 指标中的可收集指标。A list of collectible metrics for Host and Guest VM metrics on Azure Stack are available at Supported metrics with Azure Monitor on Azure Stack.

活动日志Activity log

可以在活动日志中搜索有关 Azure Stack 基础结构看到的计算资源的信息。You can search the activity logs for information about your compute resources as seen by the Azure Stack infrastructure. 日志包含多种信息,例如创建或销毁资源的时间。The log contains information such as times when resources are created or destroyed. Azure Stack 上的活动日志与 Azure 是一致的。The activity logs on Azure Stack is consistent with Azure. 有关详细信息,请参阅 Azure 上的活动日志概述的说明。For more information, see the description of Activity log overview on Azure.

Azure Monitor 源:所有其他项Azure monitor sources: everything else

Azure Stack 上的 Azure Monitor 源 - 所有其他项

资源 - 指标和诊断日志Resources - Metrics and Diagnostics logs

可收集的指标和诊断日志因资源类型而异。Collectible metrics and diagnostics logs vary based on the resource type. 支持的指标中提供了 Azure Stack 上的每种资源的可收集指标的列表。A list of collectible metrics for each resource on Azure Stack is available at supported metrics. 有关详细信息,请参阅 Azure Stack 上的 Azure Monitor 支持的指标For more information, see Supported metrics with Azure Monitor on Azure Stack.

活动日志Activity log

对于计算资源,活动日志是相同的。The activity log is the same for compute resources.

用于监视数据Uses for monitoring data

存储和存档Store and Archive

某些监视数据已存储并且在设定的时间段内在 Azure Monitor 中可用。Some monitoring data is already stored and available in Azure Monitor for a set amount of time.

  • 指标存储 90 天。Metrics are stored for 90 days.
  • 活动日志条目存储 90 天。Activity log entries are stored for 90 days.
  • 诊断日志不存储。Diagnostics logs are not stored.
  • 将数据存档到存储帐户可以保留更长时间。Archive the data to a storage account for longer retention.


可以使用 Azure 监视器 REST API、跨平台命令行接口 (CLI) 命令、PowerShell cmdlet 或 .NET SDK 访问系统或 Azure 存储中的数据。You can use the Azure Monitor REST API, cross-platform Command-Line Interface (CLI) commands, PowerShell cmdlets, or the .NET SDK to access the data in the system or Azure storage.


以图形和图表形式将监视数据可视化可以帮助你更快地查明趋势,其速度远非单纯查看数据可比。Visualizing your monitoring data in graphics and charts helps you find trends quicker than looking through the data itself.

可视化方法包括:A few visualization methods include:

  • 使用 Azure Stack 用户和管理员门户Use the Azure Stack user and admin portal
  • 将数据路由到 Azure Power BIRoute data to Azure Power BI
  • 将数据路由到第三方可视化工具,可以使用实时传送视频流,也可以让工具从 Azure 存储中的存档读取。Route the data to a third-party visualization tool using either live streaming or by having the tool read from an archive in Azure storage

访问 Azure Stack 上的 Azure Monitor 的方法Methods of accessing Azure monitor on Azure Stack

一般情况下,可以使用下述方法之一操作数据的跟踪、路由和检索。In general, you can manipulate data tracking, routing, and retrieval using one of the following methods. 并非所有方法都适用于所有操作或数据类型。Not all methods are available for all actions or data types.

后续步骤Next steps

使用 Azure Stack 中的监视数据一文中详细了解有关使用 Azure Stack 中的监视数据的选项。Learn more about the options of the monitoring data consumption on Azure Stack in the article Consume monitoring data from Azure Stack.