Azure 诊断扩展概述Azure Diagnostics extension overview

Azure 诊断扩展是 Azure Monitor 中的代理,可从 Azure 计算资源(包括虚拟机)的来宾操作系统中收集监视数据。Azure Diagnostics extension is an agent in Azure Monitor that collects monitoring data from the guest operating system of Azure compute resources including virtual machines. 本文概述了 Azure 诊断扩展,其中包括它支持的具体功能以及用于安装和配置的选项。This article provides an overview of Azure Diagnostics extension including specific functionality that it supports and options for installation and configuration.

备注

Azure 诊断扩展是一个代理,适用于从计算资源的来宾操作系统中收集监视数据。Azure Diagnostics extension is one of the agents available to collect monitoring data from the guest operating system of compute resources. 请参阅 Azure Monitor 代理概述,了解不同代理的说明,以及如何按要求选择适当的代理。See Overview of the Azure Monitor agents for a description of the different agents and guidance on selecting the appropriate agents for your requirements.

主要方案Primary scenarios

诊断扩展解决的主要方案是:The primary scenarios addressed by the diagnostics extension are:

  • 将来宾指标收集到 Azure Monitor 指标中。Collect guest metrics into Azure Monitor Metrics.
  • 将来宾日志和指标发送到 Azure 存储以进行存档。Send guest logs and metrics to Azure storage for archiving.
  • 将来宾日志和指标发送到 Azure 事件中心,以在 Azure 外部发送。Send guest logs and metrics to Azure event hubs to send outside of Azure.

与 Log Analytics 代理比较Comparison to Log Analytics agent

Azure Monitor 中的 Log Analytics 代理还可以用来从虚拟机的来宾操作系统收集监视数据。The Log Analytics agent in Azure Monitor can also be used to collect monitoring data from the guest operating system of virtual machines. 可以根据要求选择使用任一项,或者二者都使用。You may choose to use either or both depending on your requirements. 请参阅 Azure Monitor 代理概述,详细比较 Azure Monitor 代理。See Overview of the Azure Monitor agents for a detailed comparison of the Azure Monitor agents.

需要考虑的主要差异为:The key differences to consider are:

  • Azure 诊断扩展只能与 Azure 虚拟机配合使用。Azure Diagnostics Extension can be used only with Azure virtual machines. Log Analytics 代理可以与 Azure 中的、其他云中的和本地的虚拟机配合使用。The Log Analytics agent can be used with virtual machines in Azure, other clouds, and on-premises.
  • Azure 诊断扩展将数据发送到 Azure 存储、Azure Monitor 指标(仅限 Windows)和事件中心。Azure Diagnostics extension sends data to Azure Storage, Azure Monitor Metrics (Windows only) and Event Hubs. Log Analytics 代理将数据收集到 Azure Monitor 日志中。The Log Analytics agent collects data to Azure Monitor Logs.
  • 解决方案和其他服务(如 Azure 安全中心)需要 Log Analytics 代理。The Log Analytics agent is required for solutions, and other services such as Azure Security Center.

成本Costs

Azure 诊断扩展不会产生费用,但可能会产生数据引入费用。There is no cost for Azure Diagnostic Extension, but you may incur charges for the data ingested. 检查与要将数据收集到其中的目标相对应的 Azure Monitor 定价Check Azure Monitor pricing for the destination where you're collecting data.

收集的数据Data collected

下表列出了 Windows 和 Linux 诊断扩展可以收集的数据。The following tables list the data that can be collected by the Windows and Linux diagnostics extension.

Windows 诊断扩展 (WAD)Windows diagnostics extension (WAD)

数据源Data Source 说明Description
Windows 事件日志Windows Event logs Windows 事件日志中的事件。Events from Windows event log.
性能计数器Performance counters 数值,用于度量操作系统和工作负载的不同方面的性能。Numerical values measuring performance of different aspects of operating system and workloads.
IIS 日志IIS Logs 在来宾操作系统上运行的 IIS 网站的使用情况信息。Usage information for IIS web sites running on the guest operating system.
应用程序日志Application logs 应用程序写入的跟踪消息。Trace messages written by your application.
.NET EventSource 日志.NET EventSource logs 使用 .NET EventSource 类的代码编写事件Code writing events using the .NET EventSource class
基于清单的 ETW 日志Manifest based ETW logs 由任何进程生成的 Windows 事件的事件跟踪。Event Tracing for Windows events generated by any process.
故障转储(日志)Crash dumps (logs) 有关应用程序崩溃时的进程状态的信息。Information about the state of the process if an application crashes.
基于文件的日志File based logs 应用程序或服务创建的日志。Logs created by your application or service.
代理诊断日志Agent diagnostic logs 有关 Azure 诊断自身的信息。Information about Azure Diagnostics itself.

Linux 诊断扩展 (LAD)Linux diagnostics extension (LAD)

数据源Data Source 说明Description
SyslogSyslog 发送到 Linux 事件日志记录系统的事件。Events sent to the Linux event logging system.
性能计数器Performance counters 数值,用于度量操作系统和工作负载的不同方面的性能。Numerical values measuring performance of different aspects of operating system and workloads.
日志文件Log files 发送到基于文件的日志的条目。Entries sent to a file based log.

数据目标Data destinations

Windows 和 Linux 的 Azure 诊断扩展始终将数据收集到 Azure 存储帐户中。The Azure Diagnostic extension for both Windows and Linux always collect data into an Azure Storage account. 请参阅安装并配置 Windows Azure 诊断扩展 (WAD)使用 Linux 诊断扩展监视指标和日志,获取一系列特定的表和 blob,可以在其中收集该数据。See Install and configure Windows Azure diagnostics extension (WAD) and Use Linux Diagnostic Extension to monitor metrics and logs for a list of specific tables and blobs where this data is collected.

配置一个或多个数据接收器,以便将数据发送到其他额外的目标。Configure one or more data sinks to send data to other additional destinations. 以下部分列出了适用于 Windows 和 Linux 诊断扩展的接收器。The following sections list the sinks available for the Windows and Linux diagnostics extension.

Windows 诊断扩展 (WAD)Windows diagnostics extension (WAD)

目标Destination 说明Description
事件中心Event hubs 使用 Azure 事件中心在 Azure 外部发送数据。Use Azure Event Hubs to send data outside of Azure. 请参阅将 Azure 诊断数据流式传输到事件中心See Streaming Azure Diagnostics data to Event Hubs
Azure 存储 BlobAzure Storage blobs 除表外,还将数据写入 Azure 存储中的 Blob。Write to data to blobs in Azure Storage in addition to tables.
Application InsightsApplication Insights 将数据从 VM 中运行的应用程序收集到可以与其他应用程序监视功能集成的 Application Insights。Collect data from applications running in your VM to Application Insights to integrate with other application monitoring. 请参阅将诊断数据发送到 Application InsightsSee Send diagnostic data to Application Insights.

还可以将存储中的 WAD 数据收集到 Log Analytics 工作区,以便使用 Azure Monitor 日志对其进行分析,尽管通常使用 Log Analytics 代理来执行此功能。You can also collect WAD data from storage into a Log Analytics workspace to analyze it with Azure Monitor Logs although the Log Analytics agent is typically used for this functionality. 它可以将数据直接发送到 Log Analytics 工作区,并支持那些提供附加功能的解决方案和见解。It can send data directly to a Log Analytics workspace and supports solutions and insights that provide additional functionality. 请参阅从 Azure 存储收集 Azure 诊断日志See Collect Azure diagnostic logs from Azure Storage.

Linux 诊断扩展 (LAD)Linux diagnostics extension (LAD)

LAD 将数据写入 Azure 存储中的表。LAD writes data to tables in Azure Storage. 它支持下表中的接收器。It supports the sinks in the following table.

目标Destination 说明Description
事件中心Event hubs 使用 Azure 事件中心在 Azure 外部发送数据。Use Azure Event Hubs to send data outside of Azure.
Azure 存储 BlobAzure Storage blobs 除了表以外,还会将数据写入 Azure 存储中的 blob。Write to data to blobs in Azure Storage in addition to tables.

安装和配置Installation and configuration

诊断扩展作为 Azure 中的虚拟机扩展实现,因此,它支持相同的、使用资源管理器模板、PowerShell 和 CLI 的安装选项。The Diagnostic extension is implemented as a virtual machine extension in Azure, so it supports the same installation options using Resource Manager templates, PowerShell, and CLI. 有关安装和维护虚拟机扩展的常规详细信息,请参阅适用于 Windows 的虚拟机扩展和功能适用于 Linux 的虚拟机扩展和功能See Virtual machine extensions and features for Windows and Virtual machine extensions and features for Linux for general details on installing and maintaining virtual machine extensions.

还可以在 Azure 门户中虚拟机菜单的“监视”部分的“诊断设置”下安装并配置 Windows 和 Linux 诊断扩展。 You can also install and configure both the Windows and Linux diagnostic extension in the Azure portal under Diagnostic settings in the Monitoring section of the virtual machine's menu.

有关安装并配置适用于 Windows 和 Linux 的诊断扩展的详细信息,请参阅以下文章。See the following articles for details on installing and configuring the diagnostics extension for Windows and Linux.

其他文档Other documentation

Azure 云服务(经典)的 Web 角色和辅助角色Azure Cloud Service (classic) Web and Worker Roles

Azure Service FabricAzure Service Fabric

后续步骤Next steps