Azure Monitor 的监视数据源Sources of monitoring data for Azure Monitor

Azure Monitor 基于包含日志指标通用监视数据平台Azure Monitor is based on a common monitoring data platform that includes Logs and Metrics. 将数据收集到此平台后,可以使用 Azure Monitor 中的一组通用工具统一分析来自多个资源的数据。Collecting data into this platform allows data from multiple resources to be analyzed together using a common set of tools in Azure Monitor. 还可以将监视数据发送到其他位置以支持特定的方案,某些资源可能会将数据写入到其他位置,然后可以在日志或指标中收集数据。Monitoring data may also be sent to other locations to support certain scenarios, and some resources may write to other locations before they can be collected into Logs or Metrics.

本文介绍 Azure Monitor 收集的不同监视数据源,以及 Azure 资源创建的监视数据。This article describes the different sources of monitoring data collected by Azure Monitor in addition to the monitoring data created by Azure resources. 本文还提供了有关在不同位置收集这些数据所需的配置的详细信息的链接。Links are provided to detailed information on configuration required to collect this data to different locations.

应用程序层Application tiers

Azure 应用程序中的监视数据源可以组织为层,最高的层是应用程序本身,较低的层是 Azure 平台的组件。Sources of monitoring data from Azure applications can be organized into tiers, the highest tiers being your application itself and the lower tiers being components of Azure platform. 从每个层访问数据的方法各不相同。The method of accessing data from each tier varies. 下表汇总了应用层,后续部分将介绍每个层中的监视数据源。The application tiers are summarized in the table below, and the sources of monitoring data in each tier are presented in the following sections. 有关每个数据位置的说明以及如何访问其中的数据,请参阅 Azure 中的监视数据位置See Monitoring data locations in Azure for a description of each data location and how you can access its data.

监视层

AzureAzure

下表概述了特定于 Azure 的应用层。The following table briefly describes the application tiers that are specific to Azure. 单击链接可在后续部分查看有关每个层的更多详细信息。Following the link for further details on each in the sections below.

Tier 说明Description 收集方法Collection method
Azure 租户Azure Tenant 有关租户级 Azure 服务(例如 Azure Active Directory)操作的数据。Data about the operation of tenant-level Azure services, such as Azure Active Directory. 在门户中查看 AAD 数据,或者配置为使用租户诊断设置将数据收集到 Azure Monitor。View AAD data in portal or configure collection to Azure Monitor using a tenant diagnostic setting.
Azure 订阅Azure subscription 与 Azure 订阅中的跨资源服务运行状况和管理(例如资源管理器和服务运行状况)相关的数据。Data related to the health and management of cross-resource services in your Azure subscription such as Resource Manager and Service Health. 在门户中查看数据,或者配置为使用日志配置文件将数据收集到 Azure Monitor。View in portal or configure collection to Azure Monitor using a log profile.
Azure 资源Azure resources 有关每个 Azure 资源的操作和性能的数据。Data about the operation and performance of each Azure resource. 自动收集的指标,在指标资源管理器中查看。Metrics collected automatically, view in Metrics Explorer.
配置用于在 Azure Monitor 中收集日志的诊断设置。Configure diagnostic settings to collect logs in Azure Monitor.
可用于对特定资源类型进行更详细监视的监视解决方案和见解。Monitoring solutions and Insights available for more detailed monitoring for specific resource types.

Azure、其他云或本地Azure, other cloud, or on-premises

下表概述了可部署在 Azure、其他云中或本地的应用层。The following table briefly describes the application tiers that may be in Azure, another cloud, or on-premises. 单击链接可在后续部分查看有关每个层的更多详细信息。Following the link for further details on each in the sections below.

Tier 说明Description 收集方法Collection method
操作系统(来宾)Operating system (guest) 有关计算资源上的操作系统的数据。Data about the operating system on compute resources. 安装 Log Analytics 代理以将客户端数据源收集到 Azure Monitor,并安装依赖项代理以收集支持用于 VM 的 Azure Monitor 的依赖项。Install Log Analytics agent to collect client data sources into Azure Monitor and Dependency agent to collect dependencies supporting Azure Monitor for VMs.
对于 Azure 虚拟机,请安装 Azure 诊断扩展以将日志和指标收集到 Azure Monitor。For Azure virtual machines, install Azure Diagnostic Extension to collect logs and metrics into Azure Monitor.
应用程序代码Application Code 有关实际应用程序和代码的性能与功能,包括性能跟踪、应用程序日志和用户遥测数据。Data about the performance and functionality of the actual application and code, including performance traces, application logs, and user telemetry. 检测代码以将数据收集到 Application Insights 中。Instrument your code to collect data into Application Insights.
自定义源Custom sources 来自外部服务或者其他组件或设备的数据。Data from external services or other components or devices. 从任何 REST 客户端将日志或指标数据收集到 Azure Monitor 中。Collect log or metrics data into Azure Monitor from any REST client.

Azure 租户Azure tenant

与你的 Azure 租户相关的遥测数据是从租户级服务(例如 Azure Active Directory)中收集的。Telemetry related to your Azure tenant is collected from tenant-wide services such as Azure Active Directory.

Azure 租户集合

Azure 订阅Azure subscription

与 Azure 订阅的运行状况和操作相关的遥测数据。Telemetry related to the health and operation of your Azure subscription.

Azure 订阅

Azure 活动日志Azure Activity log

Azure 活动日志包含服务运行状况记录,以及对 Azure 订阅中的资源所做的配置更改的记录。The Azure Activity log includes service health records along with records on any configuration changes made to the resources in your Azure subscription. 活动日志可供所有 Azure 资源使用,代表其外部视图。 The Activity log is available to all Azure resources and represents their external view.

目标Destination 说明Description 参考Reference
活动日志Activity log 活动日志将收集到其自身的数据存储中,可以通过 Azure Monitor 菜单查看这些日志,或使用它来创建活动日志警报。The Activity log is collected into its own data store that you can view from the Azure Monitor menu or use to create Activity log alerts. 在 Azure 门户中查询活动日志Query the Activity log in the Azure portal
Azure Monitor 日志Azure Monitor Logs 配置 Azure Monitor 日志来收集活动日志,以结合其他监视数据对其进行分析。Configure Azure Monitor Logs to collect the Activity log to analyze it with other monitoring data. 收集和分析 Azure Monitor 的 Log Analytics 工作区中的 Azure 活动日志Collect and analyze Azure activity logs in Log Analytics workspace in Azure Monitor
Azure 存储Azure Storage 将活动日志导出到 Azure 存储进行存档。Export the Activity log to Azure Storage for archiving. 存档活动日志Archive Activity log
事件中心Event Hubs 使用事件中心将活动日志流式传输到其他位置Stream the Activity log to other locations using Event Hubs 将活动日志流式传输到事件中心Stream Activity log to Event Hub.

Azure 服务运行状况Azure Service Health

Azure 服务运行状况提供订阅中应用程序和资源所依赖的 Azure 服务的运行状况信息。Azure Service Health provides information about the health of the Azure services in your subscription that your application and resources rely on.

目标Destination 说明Description 参考Reference
活动日志Activity log
Azure Monitor 日志Azure Monitor Logs
服务运行状况记录存储在 Azure 活动日志中,因此,可以在 Azure 门户中查看这些记录,或者像处理活动日志时一样对这些记录执行任何其他活动。Service Health records are stored in the Azure Activity log, so you can view them in the Azure portal or perform any other activities you can perform with the Activity log. 使用 Azure 门户查看服务运行状况通知View service health notifications by using the Azure portal

Azure 资源Azure resources

指标和资源级诊断日志提供 Azure 资源的内部操作的信息。Metrics and resource level diagnostic logs provide information about the internal operation of Azure resources. 这些日志适用于大多数 Azure 服务,监视解决方案和见解将收集特定服务的其他数据。These are available for most Azure services, and monitoring solutions and insights collect additional data for particular services.

Azure 资源收集

平台指标Platform metrics

大多数 Azure 服务会将平台指标直接发送到指标数据库,这些指标反映了其性能和运行情况。Most Azure services will send platform metrics that reflect their performance and operation directly to the metrics database. 具体指标因资源类型而异The specific metrics will vary for each type of resource.

目标Destination 说明Description 参考Reference
Azure Monitor 指标Azure Monitor Metrics 平台指标将写入到 Azure Monitor 指标数据库,无需进行任何配置。Platform metrics will write to the Azure Monitor metrics database with no configuration. 从指标资源管理器访问平台指标。Access platform metrics from Metrics Explorer. Azure 指标资源管理器入门Getting started with Azure Metrics Explorer
Azure Monitor 支持的指标Supported metrics with Azure Monitor
Azure Monitor 日志Azure Monitor Logs 将平台指标复制到日志中,以使用 Log Analytics 进行趋势分析和其他分析。Copy platform metrics to Logs for trending and other analysis using Log Analytics. 将 Azure 诊断定向到 Log AnalyticsAzure diagnostics direct to Log Analytics
事件中心Event Hubs 使用事件中心将指标流式传输到其他位置。Stream metrics to other locations using Event Hubs. 将 Azure 监视数据流式传输到事件中心以便外部工具使用Stream Azure monitoring data to an event hub for consumption by an external tool

诊断日志Diagnostic logs

诊断日志提供 Azure 资源的内部运行情况的见解。 Diagnostic logs provide insights into the internal operation of an Azure resource. 默认情况下未启用诊断日志。Diagnostic logs are not enabled by default. 必须启用诊断日志,并指定每个资源的目标。You must enable them and specify a destination for each resource.

诊断日志的配置要求和内容因资源类型而异,并非所有服务都创建诊断日志。The configuration requirements and content of Diagnostic logs vary by resource type, and not all services yet create Diagnostic logs. 有关每个服务的详细信息和详细配置过程的链接,请参阅 Azure 诊断日志支持的服务、架构和类别See Supported services, schemas, and categories for Azure Diagnostic Logs for details on each service and links to detailed configuration procedures. 如果某个服务未在本文中列出,则表示该服务目前不会将数据写入诊断日志。If the service isn�t listed in this article, then that service doesn�t currently write to diagnostic logs.

目标Destination 说明Description 参考Reference
Azure Monitor 日志Azure Monitor Logs 将诊断日志发送到 Azure Monitor 日志,以结合收集的其他日志数据进行分析。Send Diagnostic Logs to Azure Monitor Logs for analysis with other collected log data. 某些资源可以直接写入到 Azure Monitor 中,而另一些资源则只能先写入到存储帐户,然后导入到 Log Analytics 工作区中。Some resources can write directly to Azure Monitor while others write to a storage account before being imported into a Log Analytics workspace. 将 Azure 诊断日志流式传输到 Azure Monitor 中的 Log Analytics 工作区Stream Azure Diagnostic Logs to Log Analytics workspace in Azure Monitor
使用 Azure 门户从 Azure 存储中收集日志Use the Azure portal to collect logs from Azure Storage
存储Storage 将诊断日志发送到 Azure 存储进行存档。Send Diagnostic logs to Azure Storage for archiving. 存档 Azure 诊断日志Archive Azure Diagnostic Logs
事件中心Event Hubs 使用事件中心将诊断日志流式传输到其他位置。Stream Diagnostic logs to other locations using Event Hubs. 将 Azure 诊断日志流式传输到事件中心Stream Azure Diagnostic Logs to an event hub

操作系统(来宾)Operating system (guest)

Azure 中的、其他云中的以及本地的计算资源都有要监视的来宾操作系统。Compute resources in Azure, in other clouds, and on-premises have a guest operating system to monitor. 安装一个或多个代理后,可将来宾发出的遥测数据收集到 Azure Monitor 中,以使用与 Azure 服务本身相同的监视工具对其进行分析。With the installation of one or more agents, you can gather telemetry from the guest into Azure Monitor to analyze it with the same monitoring tools as the Azure services themselves.

Azure 计算资源收集

Azure 诊断扩展Azure Diagnostic extension

启用适用于 Azure 虚拟机的 Azure 诊断扩展可从 Azure 计算资源(包括 Azure 云服务(经典)Web 角色与辅助角色、虚拟机、虚拟机规模集及 Service Fabric)的来宾操作系统收集日志和指标。Enabling the Azure Diagnostics extension for Azure Virtual machines allows you to collect logs and metrics from the guest operating system of Azure compute resources including Azure Cloud Service (classic) Web and Worker Roles, Virtual Machines, virtual machine scale sets, and Service Fabric.

目标Destination 说明Description 参考Reference
存储Storage 启用诊断扩展后,默认情况下,它会将数据写入存储帐户。When you enable the Diagnostics Extension, it will write to a storage account by default. 在 Azure 存储中存储和查看诊断数据Store and view diagnostic data in Azure Storage
Azure Monitor 指标Azure Monitor Metrics 配置用于收集性能计数器的诊断扩展时,这些计数器将写入到 Azure Monitor 指标数据库。When you configure the Diagnostics Extension to collect performance counters, they are written to the Azure Monitor metrics database. 使用 Windows 虚拟机的资源管理器模板将来宾 OS 指标发送到 Azure Monitor 指标存储Send Guest OS metrics to the Azure Monitor metric store using a Resource Manager template for a Windows virtual machine
Application Insights 日志Application Insights Logs 从支持应用程序的计算资源收集日志和性能计数器,以结合其他应用程序数据对其进行分析。Collect logs and performance counters from the compute resource supporting your application to be analyzed with other application data. 将云服务、虚拟机或 Service Fabric 诊断数据发送到 Application InsightsSend Cloud Service, Virtual Machine, or Service Fabric diagnostic data to Application Insights
事件中心Event Hubs 配置诊断扩展,以使用事件中心将数据流式传输到其他位置。Configure the Diagnostics Extension to stream the data to other locations using Event Hubs. 使用事件中心流式处理热路径中的 Azure 诊断数据Streaming Azure Diagnostics data in the hot path by using Event Hubs

Log Analytics 代理Log Analytics agent

安装 Log Analytics 代理,以便对 Windows 或 Linux 虚拟机进行全面的监视和管理。Install the Log Analytics agent for comprehensive monitoring and management of your Windows or Linux virtual machines. 虚拟机可以在 Azure 中运行,也可以在其他云中或本地运行。The virtual machine can be running in Azure, another cloud, or on-premises.

目标Destination 说明Description 参考Reference
Azure Monitor 日志Azure Monitor Logs Log Analytics 代理可以直接连接到 Azure Monitor,也可以通过 System Center Operations Manager 进行连接,可用于从配置的数据源收集数据,或者从监视解决方案收集数据,以便提供在虚拟机上运行的应用程序的更多见解。The Log Analytics agent connects to Azure Monitor either directly or through System Center Operations Manager and allows you to collect data from data sources that you configure or from monitoring solutions that provide additional insights into applications running on the virtual machine. Azure Monitor 中的代理数据源Agent data sources in Azure Monitor

用于 VM 的 Azure MonitorAzure Monitor for VMs

它要求在 Windows 和 Linux 虚拟机上安装 Dependency Agent,并与 Log Analytics 代理集成,以收集有关虚拟机上运行的进程和外部进程依赖项的发现数据。It requires a Dependency Agent on Windows and Linux virtual machines that integrates with the Log Analytics agent to collect discovered data about processes running on the virtual machine and external process dependencies.

目标Destination 说明Description 参考Reference
Azure Monitor 日志Azure Monitor Logs 存储有关代理中的进程和依赖项的数据。Stores data about processes and dependencies on the agent.
VM 存储VM Storage 用于 VM 的 Azure Monitor 在自定义位置存储运行状态信息。Azure Monitor for VMs stores heath state information in a custom location. 这仅适用于 Azure 门户以及 Azure 资源运行状况 REST API 中的用于 VM 的 Azure Monitor。This is only available to Azure Monitor for VMs in the Azure portal in addition to the Azure Resource health REST API. Azure 资源运行状况 REST APIAzure Resource health REST API

应用程序代码Application Code

Azure Monitor 中的详细应用程序监视是通过 Application Insights 完成的,该服务可从各种平台上运行的应用程序收集数据。Detailed application monitoring in Azure Monitor is done with Application Insights which collects data from applications running on a variety of platforms. 此应用程序可以在 Azure 中运行,也可以在其他云中或本地运行。The application can be running in Azure, another cloud, or on-premises.

应用程序数据收集

应用程序数据Application data

通过安装检测包为应用程序启用 Application Insights 后,它就会收集与应用程序的性能和运行相关的指标和日志。When you enable Application Insights for an application by installing an instrumentation package, it collects metrics and logs related to the performance and operation of the application. Application Insights 将它收集的数据存储在其他数据源使用的同一 Azure Monitor 数据平台中。Application Insights stores the data it collects in the same Azure Monitor data platform used by other data sources. 它包括各种用于分析此数据的工具,但是也可使用指标资源管理器和 Log Analytics 之类的工具分析来自其他源的数据。It includes extensive tools for analyzing this data, but you can also analyze it with data from other sources using tools such as Metrics Explorer and Log Analytics.

目标Destination 说明Description 参考Reference
Azure Monitor 日志Azure Monitor Logs 有关应用程序的运行数据,包括页面查看次数、应用程序请求数、异常数和跟踪数。Operational data about your application including page views, application requests, exceptions, and traces. 在 Azure Monitor 中分析日志数据Analyze log data in Azure Monitor
应用程序组件之间的依赖关系信息,用于支持应用程序映射和遥测关联。Dependency information between application components to support Application Map and telemetry correlation. Application Insights 中的遥测关联Telemetry correlation in Application Insights
应用程序映射Application Map
可用性测试(从公共 Internet 上的不同位置测试应用程序的可用性和响应能力)的结果。Results of availability tests that test the availability and responsiveness of your application from different locations on the public Internet. 监视任何网站的可用性和响应能力Monitor availability and responsiveness of any web site
Azure Monitor 指标Azure Monitor Metrics Application Insights 将描述应用程序的性能和运行情况的指标以及在应用程序中定义的自定义指标收集到 Azure Monitor 指标数据库中。Application Insights collects metrics describing the performance and operation of the application in addition to custom metrics that you define in your application into the Azure Monitor metrics database. Application Insights 中基于日志的指标和预先聚合的指标Log-based and pre-aggregated metrics in Application Insights
用于处理自定义事件和指标的 Application Insights APIApplication Insights API for custom events and metrics
Azure 存储Azure Storage 将应用程序数据发送到 Azure 存储进行存档。Send application data to Azure Storage for archiving. 从 Application Insights 导出遥测数据Export telemetry from Application Insights
可用性测试的详细信息存储在 Azure 存储中。Details of availability tests are stored in Azure Storage. 可使用 Azure 门户中 Application Insights 将其下载到本地进行分析。Use Application Insights in the Azure portal to download for local analysis. 可用性测试的结果存储在 Azure Monitor 日志中。Results of availability tests are stored in Azure Monitor Logs. 监视任何网站的可用性和响应能力Monitor availability and responsiveness of any web site
Profiler 跟踪数据存储在 Azure 存储中。Profiler trace data is stored in Azure Storage. 可使用 Azure 门户中 Application Insights 将其下载到本地进行分析。Use Application Insights in the Azure portal to download for local analysis.

监视解决方案和见解Monitoring Solutions and Insights

监视解决方案见解通过收集数据来提供针对特定服务或应用程序的更多操作见解。Monitoring solutions and Insights collect data to provide additional insights into the operation of a particular service or application. 它们可以解决不同应用层甚至多个层中的资源需求。They may address resources in different application tiers and even multiple tiers.

监视解决方案Monitoring solutions

目标Destination 说明Description 参考Reference
Azure Monitor 日志Azure Monitor Logs 监视解决方案将数据收集到 Azure Monitor 日志中,以便在其中使用查询语言或通常包括在解决方案中的视图对这些数据进行分析。Monitoring solutions collect data into Azure Monitor logs where it may be analyzed using the query language or views that are typically included in the solution. Azure 中的监视解决方案的数据收集详细信息Data collection details for monitoring solutions in Azure

用于容器的 Azure MonitorAzure Monitor for Containers

用于容器的 Azure MonitorAzure Kubernetes 服务 (AKS) 提供自定义的监视体验。Azure Monitor for Containers provides a customized monitoring experience for Azure Kubernetes Service (AKS). 它会收集有关这些资源的其他数据,如下表中所述。It collects additional data about these resources described in the following table.

目标Destination 说明Description 参考Reference
Azure Monitor 日志Azure Monitor Logs 存储 AKS 的监视数据,包括库存、日志和事件。Stores monitoring data for AKS including inventory, logs, and events. 指标数据还会存储在“日志”中,这样就可以在门户中利用其分析功能。Metric data is also stored in Logs in order to leverage its analysis functionality in the portal. 使用适用于容器的 Azure Monitor 了解 AKS 群集性能Understand AKS cluster performance with Azure Monitor for containers
Azure Monitor 指标Azure Monitor Metrics 指标数据将存储在指标数据库中,以驱动可视化和警报。Metric data is stored in the metric database to drive visualization and alerts. 在指标资源管理器中查看容器指标View container metrics in metrics explorer
Azure Kubernetes 服务Azure Kubernetes Service 为了提供近实时体验,用于容器的 Azure Monitor 直接通过 Azure 门户中的 Azure Kubernetes 服务显示数据。In order to a near real time experience, Azure Monitor for Containers presents data directly from the Azure Kubernetes service in the Azure portal. 如何使用用于容器的 Azure Monitor(预览版)实时查看容器日志How to view container logs real time with Azure Monitor for containers (preview)

用于 VM 的 Azure MonitorAzure Monitor for VMs

用于 VM 的 Azure Monitor 提供自定义的体验用于监视虚拟机。Azure Monitor for VMs provides a customized experience for monitoring virtual machines. 前面的操作系统(来宾)部分介绍了用于 VM 的 Azure Monitor 收集的数据。A description of the data collected by Azure Monitor for VMs is included in the Operating System (guest) section above.

自定义来源Custom sources

除了应用程序的标准层之外,还可能需要监视具有不能与其他数据源一起收集的遥测数据的其他资源。In addition to the standard tiers of an application, you may need to monitor other resources that have telemetry that can't be collected with the other data sources. 对于这些资源,可使用 Azure Monitor API 将此数据写入到指标或日志。For these resources, write this data to either Metrics or Logs using an Azure Monitor API.

自定义收集

目标Destination 方法Method 说明Description 参考Reference
Azure Monitor 日志Azure Monitor Logs 数据收集器 APIData Collector API 从任何 REST 客户端收集日志数据,并将其存储在 Log Analytics 工作区中。Collect log data from any REST client and store in Log Analytics workspace. 使用 HTTP 数据收集器 API(公共预览版)将日志数据发送到 Azure MonitorSend log data to Azure Monitor with the HTTP Data Collector API (public preview)

其他服务Other services

Azure 中的其他服务将数据写入到 Azure Monitor 数据平台。Other services in Azure write data to the Azure Monitor data platform. 这样,你便可以结合 Azure Monitor 收集的数据来分析这些服务收集的数据,并利用相同的分析和可视化工具。This allows you to analyze data collected by these services with data collected by Azure Monitor and leverage the same analysis and visualization tools.

服务Service 目标Destination 说明Description 参考Reference
Azure 安全中心Azure Security Center Azure Monitor 日志Azure Monitor Logs Azure 安全中心将它收集的安全数据存储在 Log Analytics 工作区中,可以结合 Azure Monitor 收集的其他日志数据对其进行分析。Azure Security Center stores the security data it collects in a Log Analytics workspace which allows it to be analyzed with other log data collected by Azure Monitor. Azure 安全中心内的数据收集[Data collection in Azure Security Center Azure Monitor 日志Azure Monitor Logs Azure Sentinel 将它从不同数据源收集的数据存储在 Log Analytics 工作区中,可以结合 Azure Monitor 收集的其他日志数据对其进行分析。Azure Sentinel stores the data it collects from different data sources in a Log Analytics workspace which allows it to be analyzed with other log data collected by Azure Monitor.

后续步骤Next steps