配置 Azure SQL 数据库和 Azure SQL 托管实例诊断遥测的流式导出Configure streaming export of Azure SQL Database and SQL Managed Instance diagnostic telemetry

适用于:是 Azure SQL 数据库 是Azure SQL 托管实例 APPLIES TO: yesAzure SQL Database yesAzure SQL Managed Instance

本文介绍可导出到多个目标之一以进行分析的 Azure SQL 数据库性能指标和资源日志。In this article, you will learn about the performance metrics and resource logs for Azure SQL Database that you can export to one of several destinations for analysis. 其中将会介绍如何通过 Azure 门户、PowerShell、Azure CLI、REST API 和 Azure 资源管理器模板配置这些诊断遥测数据的流式导出。You will learn how to configure the streaming export of this diagnostic telemetry through the Azure portal, PowerShell, Azure CLI, the REST API, and Azure Resource Manager templates.

此外,介绍可将此诊断遥测数据流式传输到哪些目标,以及如何选择不同的目标。You will also learn about the destinations to which you can stream this diagnostic telemetry and how to choose among these choices. 目标选项包括:Your destination options include:

  • Log AnalyticsLog Analytics
  • 事件中心Event Hubs
  • Azure 存储Azure Storage

导出的诊断遥测Diagnostic telemetry for export

在可导出的诊断遥测数据中,最重要的是智能见解 (SQLInsights) 日志。Most important among the diagnostic telemetry that you can export is the Intelligent Insights (SQLInsights) log. 智能见解使用内置智能,通过人工智能持续监视数据库使用情况,并检测导致性能不佳的干扰性事件。Intelligent Insights uses built-in intelligence to continuously monitor database usage through artificial intelligence and detect disruptive events that cause poor performance. 检测后,将执行详细分析,并生成包含对问题的智能评估的智能见解日志。Once detected, a detailed analysis is performed that generates a Intelligent Insights log with an intelligent assessment of the issue. 此评估包含对数据库性能问题的根本原因分析,以及为性能改进而提供的可行性建议。This assessment consists of a root cause analysis of the database performance issue and, where possible, recommendations for performance improvements. 需要配置此日志的流式导出才能查看其内容。You need to configure the streaming export of this log to view its contents.

除了流式导出智能见解日志以外,还可以导出各种性能指标和其他数据库日志。In addition to streaming the export of the Intelligent Insights log, you can also export a variety of performance metrics and additional database logs. 下表描述了可以配置为流式导出到多个目标之一的性能指标和资源日志。The following table describes the performance metrics and resources logs that you can configure for streaming export to one of several destinations. 可为单一数据库、弹性池和共用数据库以及托管实例和实例数据库配置此诊断遥测。This diagnostic telemetry can be configured for single databases, elastic pools and pooled databases, and managed instances and instance databases.

数据库的诊断遥测Diagnostic telemetry for databases Azure SQL 数据库支持Azure SQL Database support Azure SQL 托管实例支持Azure SQL Managed Instance support
基本指标:包含 DTU/CPU 百分比、DTU/CPU 限制、物理数据读取百分比、日志写入百分比、成功/失败/防火墙阻止的连接数、会话百分比、辅助角色百分比、存储、存储百分比和 XTP 存储百分比。Basic metrics: Contains DTU/CPU percentage, DTU/CPU limit, physical data read percentage, log write percentage, Successful/Failed/Blocked by firewall connections, sessions percentage, workers percentage, storage, storage percentage, and XTP storage percentage. Yes No
实例和应用高级指标:包含所使用的 tempdb 系统数据库数据和日志文件大小以及 tempdb 百分比日志文件。Instance and App Advanced: Contains tempdb system database data and log file size and tempdb percent log file used. Yes No
QueryStoreRuntimeStatistics:包含有关查询运行时统计信息的信息,例如 CPU 使用率、查询持续时间统计信息。QueryStoreRuntimeStatistics: Contains information about the query runtime statistics such as CPU usage and query duration statistics. Yes Yes
QueryStoreWaitStatistics:包含有关查询等待统计信息的信息(查询正在等待什么),例如 CPU、日志和锁定。QueryStoreWaitStatistics: Contains information about the query wait statistics (what your queries waited on) such are CPU, LOG, and LOCKING. Yes Yes
错误:包含有关数据库发生的 SQL 错误的信息。Errors: Contains information about SQL errors on a database. Yes Yes
DatabaseWaitStatistics:包含有关数据库针对不同等待类型花费多少时间等待的信息。DatabaseWaitStatistics: Contains information about how much time a database spent waiting on different wait types. Yes No
Timeouts:包含有关数据库发生的超时的信息。Timeouts: Contains information about timeouts on a database. Yes No
Blocks:包含有关数据库发生的阻塞事件的信息。Blocks: Contains information about blocking events on a database. Yes No
死锁数:包含有关数据库发生的死锁事件的信息。Deadlocks: Contains information about deadlock events on a database. Yes No
AutomaticTuning:包含有关数据库的自动优化建议的信息。AutomaticTuning: Contains information about automatic tuning recommendations for a database. Yes No
SQLInsights:包含针对数据库性能的智能见解。SQLInsights: Contains Intelligent Insights into performance for a database. 有关详细信息,请参阅智能见解To learn more, see Intelligent Insights. Yes Yes

备注

不能为系统数据库(例如 master、msdb、model、resource 和 tempdb 数据库)配置诊断设置。Diagnostic settings cannot be configured for the system databases, such are master, msdb, model, resource and tempdb databases.

流式导出目标Streaming export destinations

此诊断遥测数据可流式传输到以下 Azure 资源之一进行分析。This diagnostic telemetry can be streamed to one of the following Azure resources for analysis.

  • Log Analytics 工作区Log Analytics workspace:

    将数据流式传输到 Log Analytics 工作区Data streamed to a Log Analytics workspace.

  • Azure 事件中心Azure Event Hubs:

    将数据流式传输到 Azure 事件中心可提供以下功能:Data streamed to an Azure Event Hubprovides the following functionality:

    • 将日志流式传输到第三方日志记录和遥测系统:将所有指标和资源日志流式传输到单个事件中心,以通过管道将日志数据传送到第三方 SIEM 或日志分析工具。Stream logs to 3rd party logging and telemetry systems: Stream all of your metrics and resource logs to a single event hub to pipe log data to a third-party SIEM or log analytics tool.
    • 生成自定义遥测和日志记录平台:可利用事件中心高度可缩放的发布-订阅功能,灵活地将指标和资源日志引入到自定义遥测平台。Build a custom telemetry and logging platform: The highly scalable publish-subscribe nature of event hubs allows you to flexibly ingest metrics and resource logs into a custom telemetry platform.
  • Azure 存储Azure Storage:

    将数据流式传输到 Azure 存储可以存档大量诊断遥测数据,并且成本只是前两种流式传输选项的一小部分。Data streamed to Azure Storage enables you to archive vast amounts of diagnostic telemetry for a fraction of the cost of the previous two streaming options.

流式传输到这些目标之一的诊断遥测数据可用于度量资源利用率和查询执行统计信息,以便更轻松地监视性能。This diagnostic telemetry streamed to one of these destinations can be used to gauge resource utilization and query execution statistics for easier performance monitoring.

体系结构

启用和配置诊断遥测数据的流式导出Enable and configure the streaming export of diagnostic telemetry

可使用以下方法之一来启用和管理指标与诊断遥测日志记录:You can enable and manage metrics and diagnostic telemetry logging by using one of the following methods:

  • Azure 门户Azure portal
  • PowerShellPowerShell
  • Azure CLIAzure CLI
  • Azure Monitor REST APIAzure Monitor REST API
  • Azure Resource Manager 模板Azure Resource Manager template

备注

若要启用安全遥测的审核日志流式传输,请参阅为数据库设置审核以及 Azure Monitor 日志和 Azure 事件中心中的审核日志To enable audit log streaming of security telemetry, see Set up auditing for your database and auditing logs in Azure Monitor logs and Azure Event Hubs.

配置诊断遥测数据的流式导出Configure the streaming export of diagnostic telemetry

可以使用 Azure 门户中的“诊断设置”菜单来启用和配置诊断遥测数据的流式传输。You can use the Diagnostics settings menu in the Azure portal to enable and configure streaming of diagnostic telemetry. 此外,还可以使用 PowerShell、Azure CLI、REST API资源管理器模板来配置诊断遥测数据的流式传输。Additionally, you can use PowerShell, the Azure CLI, the REST API, and Resource Manager templates to configure streaming of diagnostic telemetry. 可设置以下目标来流式传输诊断遥测数据:Azure 存储、Azure 事件中心和 Azure Monitor 日志。You can set the following destinations to stream the diagnostic telemetry: Azure Storage, Azure Event Hubs, and Azure Monitor logs.

重要

默认不会启用诊断遥测数据的流式导出。The streaming export of diagnostic telemetry is not enabled by default.

选择以下选项卡之一,获取有关在 Azure 门户中配置诊断遥测数据的流式导出的分步指导,以及用于在 PowerShell 和 Azure CLI 中实现相同目的的脚本。Select one of the following tabs for step-by-step guidance for configuring the streaming export of diagnostic telemetry in the Azure portal and for scripts for accomplishing the same with PowerShell and the Azure CLI.

Azure SQL 数据库中的弹性池Elastic pools in Azure SQL Database

可将弹性池资源设置为收集以下诊断遥测数据:You can set up an elastic pool resource to collect the following diagnostic telemetry:

资源Resource 监视遥测数据Monitoring telemetry
弹性池Elastic pool 基本指标包含 eDTU/CPU 百分比、eDTU/CPU 限制、物理数据读取百分比、日志写入百分比、会话百分比、辅助角色百分比、存储、存储百分比、存储限制,以及 XTP 存储百分比。Basic metrics contains eDTU/CPU percentage, eDTU/CPU limit, physical data read percentage, log write percentage, sessions percentage, workers percentage, storage, storage percentage, storage limit, and XTP storage percentage.

若要为弹性池和共用数据库配置诊断遥测数据的流式传输,需要分别配置每一项:To configure streaming of diagnostic telemetry for elastic pools and pooled databases, you need to separately configure each separately:

  • 为弹性池启用诊断遥测数据的流式传输Enable streaming of diagnostic telemetry for an elastic pool
  • 为弹性池中的每个数据库启用诊断遥测数据的流式传输Enable streaming of diagnostic telemetry for each database in elastic pool

弹性池容器具有其自己的遥测数据,与每个单独的共用数据库的遥测数据分开。The elastic pool container has its own telemetry separate from each individual pooled database's telemetry.

若要为弹性池资源启用诊断遥测流,请执行以下步骤:To enable streaming of diagnostic telemetry for an elastic pool resource, follow these steps:

  1. 在 Azure 门户中转到弹性池资源。Go to the elastic pool resource in Azure portal.

  2. 选择“诊断设置”。Select Diagnostics settings.

  3. 选择“启用诊断”(如果不存在以前的设置),或选择“编辑设置”来编辑以前的设置 Select Turn on diagnostics if no previous settings exist, or select Edit setting to edit a previous setting.

    为弹性池启用诊断

  4. 输入设置名称供自己参考。Enter a setting name for your own reference.

  5. 选择诊断数据要流式传输到的目标资源:“存档到存储帐户”、“流式传输到事件中心”或“发送到 Log Analytics”。 Select a destination resource for the streaming diagnostics data: Archive to storage account, Stream to an event hub, or Send to Log Analytics.

  6. 对于 Log Analytics,请选择“配置”,并通过选择“+创建新工作区”来创建新工作区;或者选择现有的工作区。 For log analytics, select Configure and create a new workspace by selecting +Create New Workspace, or select an existing workspace.

  7. 选中弹性池诊断遥测对应的复选框:基本指标。Select the check box for elastic pool diagnostic telemetry: Basic metrics. 为弹性池配置诊断Configure diagnostics for elastic pools

  8. 选择“保存” 。Select Save.

  9. 另外,请为弹性池中需要监视的每个数据库配置诊断遥测数据的流式传输,只需按下一部分所述的步骤操作即可。In addition, configure streaming of diagnostic telemetry for each database within the elastic pool you want to monitor by following steps described in the next section.

重要

除了为弹性池配置诊断遥测数据,还需为弹性池中的每个数据库配置诊断遥测数据。In addition to configuring diagnostic telemetry for an elastic pool, you also need to configure diagnostic telemetry for each database in the elastic pool.

Azure SQL 数据库中的数据库Databases in Azure SQL Database

可将数据库资源设置为收集以下诊断遥测数据:You can set up a database resource to collect the following diagnostic telemetry:

资源Resource 监视遥测数据Monitoring telemetry
单一数据库或共用数据库Single or pooled database 基本指标包含 DTU 百分比、已用 DTU、DTU 限制、CPU 百分比、物理数据读取百分比、日志写入百分比、成功/失败/防火墙阻止的连接数、会话百分比、辅助角色百分比、存储、存储百分比、XTP 存储百分比和死锁。Basic metrics contains DTU percentage, DTU used, DTU limit, CPU percentage, physical data read percentage, log write percentage, Successful/Failed/Blocked by firewall connections, sessions percentage, workers percentage, storage, storage percentage, XTP storage percentage, and deadlocks.

若要为单一数据库或共用数据库启用诊断遥测数据的流式传输,请执行以下步骤:To enable streaming of diagnostic telemetry for a single or a pooled database, follow these steps:

  1. 转到 Azure SQL 数据库资源。Go to Azure SQL database resource.

  2. 选择“诊断设置”。Select Diagnostics settings.

  3. 选择“启用诊断”(如果不存在以前的设置),或选择“编辑设置”来编辑以前的设置 Select Turn on diagnostics if no previous settings exist, or select Edit setting to edit a previous setting. 最多可以创建三个并行连接用于流式传输诊断遥测数据。You can create up to three parallel connections to stream diagnostic telemetry.

  4. 选择“添加诊断设置”,以便配置将诊断数据并行流式传输到多个资源。Select Add diagnostic setting to configure parallel streaming of diagnostics data to multiple resources.

    为单一数据库和共用数据库启用诊断

  5. 输入设置名称供自己参考。Enter a setting name for your own reference.

  6. 选择诊断数据要流式传输到的目标资源:“存档到存储帐户”、“流式传输到事件中心”或“发送到 Log Analytics”。 Select a destination resource for the streaming diagnostics data: Archive to storage account, Stream to an event hub, or Send to Log Analytics.

  7. 对于标准的基于事件的监视体验,请选中数据库诊断日志遥测对应的以下复选框:“SQLInsights”、“AutomaticTuning”、“QueryStoreRuntimeStatistics”、“QueryStoreWaitStatistics”、“Errors”、“DatabaseWaitStatistics”、“Timeouts”、“Blocks”和“Deadlocks”。 For the standard, event-based monitoring experience, select the following check boxes for database diagnostics log telemetry: SQLInsights, AutomaticTuning, QueryStoreRuntimeStatistics, QueryStoreWaitStatistics, Errors, DatabaseWaitStatistics, Timeouts, Blocks, and Deadlocks.

  8. 对于高级的一分钟间隔监视体验,请选中“基本”指标对应的复选框。For an advanced, one-minute-based monitoring experience, select the check box for Basic metrics.

    为 Azure SQL 数据库配置诊断

  9. 选择“保存” 。Select Save.

  10. 针对要监视的每个数据库重复上述步骤。Repeat these steps for each database you want to monitor.

提示

针对要监视的每个单一数据库和共用数据库重复上述步骤。Repeat these steps for each single and pooled database you want to monitor.

Azure SQL 托管实例中的实例Instances in Azure SQL Managed Instance

可将托管实例资源设置为收集以下诊断遥测数据:You can set up a managed instance resource to collect the following diagnostic telemetry:

资源Resource 监视遥测数据Monitoring telemetry
托管实例Managed instance ResourceUsageStats 包含 vCore 计数、平均 CPU 百分比、IO 请求数、读取/写入的字节数、保留的存储空间和已使用的存储空间。ResourceUsageStats contains vCores count, average CPU percentage, IO requests, bytes read/written, reserved storage space, and used storage space.

若要为托管实例和实例数据库配置诊断遥测数据的流式传输,需要分别配置每一项:To configure streaming of diagnostic telemetry for managed instance and instance databases, you will need to separately configure each:

  • 为托管实例启用诊断遥测数据的流式传输Enable streaming of diagnostic telemetry for managed instance
  • 为每个实例数据库启用诊断遥测流Enable streaming of diagnostic telemetry for each instance database

托管实例容器具有其自己的遥测数据,与每个实例数据库的遥测数据分开。The managed instance container has its own telemetry separate from each instance database's telemetry.

若要为托管实例资源启用诊断遥测数据的流式传输,请执行以下步骤:To enable streaming of diagnostic telemetry for a managed instance resource, follow these steps:

  1. 在 Azure 门户中转到托管实例资源。Go to the managed instance resource in Azure portal.

  2. 选择“诊断设置”。Select Diagnostics settings.

  3. 选择“启用诊断”(如果不存在以前的设置),或选择“编辑设置”来编辑以前的设置 Select Turn on diagnostics if no previous settings exist, or select Edit setting to edit a previous setting.

    为托管实例启用诊断

  4. 输入设置名称供自己参考。Enter a setting name for your own reference.

  5. 选择诊断数据要流式传输到的目标资源:“存档到存储帐户”、“流式传输到事件中心”或“发送到 Log Analytics”。 Select a destination resource for the streaming diagnostics data: Archive to storage account, Stream to an event hub, or Send to Log Analytics.

  6. 对于 Log Analytics,请选择“配置”,并通过选择“+创建新工作区”来创建新工作区;或者使用现有的工作区。 For log analytics, select Configure and create a new workspace by selecting +Create New Workspace, or use an existing workspace.

  7. 选中实例诊断遥测对应的复选框:ResourceUsageStatsSelect the check box for instance diagnostic telemetry: ResourceUsageStats.

    为托管实例配置诊断

  8. 选择“保存” 。Select Save.

  9. 另外,请为托管实例中需要监视的每个实例数据库配置诊断遥测流,只需按下一部分所述的步骤操作即可。In addition, configure streaming of diagnostic telemetry for each instance database within the managed instance you want to monitor by following the steps described in the next section.

重要

除了为托管实例配置诊断遥测数据,还需为每个实例数据库配置诊断遥测数据。In addition to configuring diagnostic telemetry for a managed instance, you also need to configure diagnostic telemetry for each instance database.

Azure SQL 托管实例中的数据库Databases in Azure SQL Managed Instance

可将实例数据库资源设置为收集以下诊断遥测数据:You can set up an instance database resource to collect the following diagnostic telemetry:

资源Resource 监视遥测数据Monitoring telemetry
实例数据库Instance database ResourceUsageStats 包含 vCore 计数、平均 CPU 百分比、IO 请求数、读取/写入的字节数、保留的存储空间和已使用的存储空间。ResourceUsageStats contains vCores count, average CPU percentage, IO requests, bytes read/written, reserved storage space, and used storage space.

若要为实例数据库启用诊断遥测数据的流式传输,请执行以下步骤:To enable streaming of diagnostic telemetry for an instance database, follow these steps:

  1. 转到托管实例中的实例数据库资源。Go to instance database resource within managed instance.

  2. 选择“诊断设置”。Select Diagnostics settings.

  3. 选择“启用诊断”(如果不存在以前的设置),或选择“编辑设置”来编辑以前的设置 Select Turn on diagnostics if no previous settings exist, or select Edit setting to edit a previous setting.

    • 最多可以创建三 (3) 个并行连接用于流式传输诊断遥测数据。You can create up to three (3) parallel connections to stream diagnostic telemetry.
    • 选择“+添加诊断设置”,配置为将诊断数据并行流式传输到多个资源。Select +Add diagnostic setting to configure parallel streaming of diagnostics data to multiple resources.

    为实例数据库启用诊断

  4. 输入设置名称供自己参考。Enter a setting name for your own reference.

  5. 选择诊断数据要流式传输到的目标资源:“存档到存储帐户”、“流式传输到事件中心”或“发送到 Log Analytics”。 Select a destination resource for the streaming diagnostics data: Archive to storage account, Stream to an event hub, or Send to Log Analytics.

  6. 选中数据库诊断遥测对应的复选框:“SQLInsights”、“QueryStoreRuntimeStatistics”、“QueryStoreWaitStatistics”和“Errors”。 Select the check boxes for database diagnostic telemetry: SQLInsights, QueryStoreRuntimeStatistics, QueryStoreWaitStatistics, and Errors. 为实例数据库配置诊断Configure diagnostics for instance databases

  7. 选择“保存” 。Select Save.

  8. 针对要监视的每个实例数据库重复上述步骤。Repeat these steps for each instance database you want to monitor.

提示

针对要监视的每个实例数据库重复上述步骤。Repeat these steps for each instance database you want to monitor.

流式传输到事件中心Stream into Event Hubs

在 Azure 门户中使用内置的“流式传输到事件中心”选项可将 Azure SQL 数据库和 Azure SQL 托管实例指标和资源日志流式传输到事件中心。You can stream Azure SQL Database and Azure SQL Managed Instance metrics and resource logs into Event Hubs by using the built-in Stream to an event hub option in the Azure portal. 此外,还可以通过 PowerShell cmdlet、Azure CLI 或 Azure Monitor REST API 使用诊断设置来启用服务总线规则 ID。You also can enable the Service Bus rule ID by using diagnostics settings via PowerShell cmdlets, the Azure CLI, or the Azure Monitor REST API. 请确保事件中心与数据库和服务器位于同一区域。Be sure that the event hub is in the same region as your database and server.

如何处理事件中心内的指标和资源日志What to do with metrics and resource logs in Event Hubs

将选定的数据流式传输到事件中心后,就离启动高级监视方案更进一步了。After the selected data is streamed into Event Hubs, you're one step closer to enabling advanced monitoring scenarios. 事件中心充当事件管道的前门。Event Hubs acts as the front door for an event pipeline. 将数据收集到事件中心后,可以使用实时分析提供程序或存储适配器转换和存储这些数据。After data is collected into an event hub, it can be transformed and stored by using a real-time analytics provider or a storage adapter. 事件中心将事件流的生成从这些事件的使用中分离出来。Event Hubs decouples the production of a stream of events from the consumption of those events. 通过这种方式,事件使用者可以访问自己的计划中的事件。In this way, event consumers can access the events on their own schedule. 有关事件中心的详细信息,请参阅:For more information on Event Hubs, see:

使用在事件中心流式传输的指标可以:You can use streamed metrics in Event Hubs to:

  • 将日志流式传输到第三方日志记录和遥测流Stream logs to third-party logging and telemetry streams

    使用事件中心流式传输,可将指标和资源日志引入到不同的第三方监视和日志分析解决方案。By using Event Hubs streaming, you can get your metrics and resource logs into various third-party monitoring and log analytics solutions.

  • 生成自定义遥测和日志记录平台Build a custom telemetry and logging platform

    是否已有一个自定义生成的遥测平台,或者正在考虑生成一个?Do you already have a custom-built telemetry platform or are considering building one? 可以利用事件中心高度可缩放的发布-订阅功能灵活引入指标和资源日志。The highly scalable publish-subscribe nature of Event Hubs allows you to flexibly ingest metrics and resource logs.

流式传输到 Azure 存储中Stream into Azure Storage

使用 Azure 门户中内置的“存档到存储帐户”选项,可以在 Azure 存储中存储指标和资源日志。You can store metrics and resource logs in Azure Storage by using the built-in Archive to a storage account option in the Azure portal. 此外,还可以通过 PowerShell cmdlet、Azure CLI 或 Azure Monitor REST API 使用诊断设置来启用存储。You can also enable Storage by using diagnostics settings via PowerShell cmdlets, the Azure CLI, or the Azure Monitor REST API.

存储帐户中指标和资源日志的架构Schema of metrics and resource logs in the storage account

设置指标和资源日志收集后,当第一行数据可用时,将在所选的存储帐户中创建一个存储容器。After you set up metrics and resource logs collection, a storage container is created in the storage account you selected when the first rows of data are available. 这些 Blob 的结构为:The structure of the blobs is:

insights-{metrics|logs}-{category name}/resourceId=/SUBSCRIPTIONS/{subscription ID}/ RESOURCEGROUPS/{resource group name}/PROVIDERS/Microsoft.SQL/servers/{resource_server}/ databases/{database_name}/y={four-digit numeric year}/m={two-digit numeric month}/d={two-digit numeric day}/h={two-digit 24-hour clock hour}/m=00/PT1H.json

或者使用更简单的形式:Or, more simply:

insights-{metrics|logs}-{category name}/resourceId=/{resource Id}/y={four-digit numeric year}/m={two-digit numeric month}/d={two-digit numeric day}/h={two-digit 24-hour clock hour}/m=00/PT1H.json

例如,基本指标的 blob 名称可能是:For example, a blob name for Basic metrics might be:

insights-metrics-minute/resourceId=/SUBSCRIPTIONS/s1id1234-5679-0123-4567-890123456789/RESOURCEGROUPS/TESTRESOURCEGROUP/PROVIDERS/MICROSOFT.SQL/ servers/Server1/databases/database1/y=2016/m=08/d=22/h=18/m=00/PT1H.json

如果存储弹性池中的数据,Blob 名称类似于:A blob name for storing data from an elastic pool looks like:

insights-{metrics|logs}-{category name}/resourceId=/SUBSCRIPTIONS/{subscription ID}/ RESOURCEGROUPS/{resource group name}/PROVIDERS/Microsoft.SQL/servers/{resource_server}/ elasticPools/{elastic_pool_name}/y={four-digit numeric year}/m={two-digit numeric month}/d={two-digit numeric day}/h={two-digit 24-hour clock hour}/m=00/PT1H.json

数据保留策略和定价Data retention policy and pricing

如果选择事件中心或存储帐户,可以指定保留策略。If you select Event Hubs or a Storage account, you can specify a retention policy. 此策略删除早于选定时间段的数据。This policy deletes data that is older than a selected time period. 如果指定 Log analytics,保留策略将取决于所选的定价层。If you specify Log Analytics, the retention policy depends on the selected pricing tier. 在这种情况下,提供的免费数据引入单位每月可免费监视多个数据库。In this case, the provided free units of data ingestion can enable free monitoring of several databases each month. 消耗的诊断遥测量超过免费单位可能会产生费用。Any consumption of diagnostic telemetry in excess of the free units might incur costs.

重要

与空闲数据相比,工作负荷较重的活动数据库越多,引入的数据就越多。Active databases with heavier workloads ingest more data than idle databases. 有关详细信息,请参阅 Log Analytics 定价For more information, see Log analytics pricing.

如果使用 Azure SQL Analytics,则可以选择 Azure SQL Analytics 导航菜单上的“OMS 工作区”,然后选择“使用情况”和“预估成本”,来监视数据引入消耗量 。If you are using Azure SQL Analytics, you can monitor your data ingestion consumption by selecting OMS Workspace on the navigation menu of Azure SQL Analytics, and then selecting Usage and Estimated Costs.

可用的指标和日志Metrics and logs available

本文的本部分介绍了如何监视适用于单一数据库、共用数据库、弹性池、托管实例和实例数据库的遥测数据。Monitoring telemetry available for single databases, pooled databases, elastic pools, managed instance, and instance databases is documented in this section of the article. 可以使用 Azure Monitor 日志查询语言将在 SQL Analytics 内收集的监视遥测数据用于你自己的自定义分析和应用程序开发。Collected monitoring telemetry inside SQL Analytics can be used for your own custom analysis and application development using Azure Monitor log queries language.

基本指标Basic metrics

请参阅下表来详细了解按资源列出的基本指标。Refer to the following tables for details about Basic metrics by resource.

备注

基本指标选项以前称为“所有指标”。Basic metrics option was formerly known as All metrics. 所做的更改仅限于命名,并未更改所监视的指标。The change made was to the naming only and there was no change to the metrics monitored. 启动此更改是为了允许将来引入更多的指标类别。This change was initiated to allow for introduction of additional metric categories in the future.

弹性池的基本指标Basic metrics for elastic pools

资源Resource 度量值Metrics
弹性池Elastic pool eDTU 百分比、已用 eDTU、eDTU 限制、CPU 百分比、物理数据读取百分比、日志写入百分比、会话百分比、辅助角色百分比、存储、存储百分比、存储限制、XTP存储百分比eDTU percentage, eDTU used, eDTU limit, CPU percentage, physical data read percentage, log write percentage, sessions percentage, workers percentage, storage, storage percentage, storage limit, XTP storage percentage

单一数据库和共用数据库的基本指标Basic metrics for single and pooled databases

资源Resource 度量值Metrics
单一数据库和共用数据库Single and pooled database DTU 百分比、已用 DTU、DTU 限制、CPU 百分比、物理数据读取百分比、日志写入百分比、成功/失败/防火墙阻止的连接数、会话百分比、辅助角色百分比、存储、存储百分比、XTP 存储百分比和死锁DTU percentage, DTU used, DTU limit, CPU percentage, physical data read percentage, log write percentage, Successful/Failed/Blocked by firewall connections, sessions percentage, workers percentage, storage, storage percentage, XTP storage percentage, and deadlocks

高级指标Advanced metrics

请参阅下表,详细了解高级指标。Refer to the following table for details about advanced metrics.

指标Metric 指标显示名称Metric Display Name 说明Description
sqlserver_process_core_percent1sqlserver_process_core_percent1 SQL 进程核心百分比SQL process core percent SQL 进程的 CPU 使用率百分比(由操作系统度量)。CPU usage percentage for the SQL process, as measured by the operating system.
sqlserver_process_memory_percent1sqlserver_process_memory_percent1 SQL 进程内存百分比SQL process memory percent SQL 进程的内存使用率百分比(由操作系统度量)。Memory usage percentage for the SQL process, as measured by the operating system.
tempdb_data_size2tempdb_data_size2 Tempdb 数据文件大小 (KB)Tempdb Data File Size Kilobytes Tempdb 数据文件大小 (KB)。Tempdb Data File Size Kilobytes.
tempdb_log_size2tempdb_log_size2 Tempdb 日志文件大小 (KB)Tempdb Log File Size Kilobytes Tempdb 日志文件大小 (KB)。Tempdb Log File Size Kilobytes.
tempdb_log_used_percent2tempdb_log_used_percent2 Tempdb 日志已用百分比Tempdb Percent Log Used Tempdb 日志已用百分比。Tempdb Percent Log Used.

1 此指标可用于这样的数据库:使用具有 2 vCore 或更多 vCore 的 vCore 购买模型,或使用具有 200 DTU 或更多 DTU 的基于 DTU 的购买模型。1 This metric is available for databases using the vCore purchasing model with 2 vCores and higher, or 200 DTU and higher for DTU-based purchasing models.

2 此指标可用于这样的数据库:使用具有 2 vCore 或更多 vCore 的 vCore 购买模型,或使用具有 200 DTU 或更多 DTU 的基于 DTU 的购买模型。2 This metric is available for databases using the vCore purchasing model with 2 vCores and higher, or 200 DTU and higher for DTU-based purchasing models. 此指标目前不可用于超大规模数据库或数据仓库。This metric is not currently available for Hyperscale databases or data warehouses.

基本日志Basic logs

下面的表中记录了适用于所有日志的遥测数据的详细信息。Details of telemetry available for all logs are documented in the following tables. 有关详细信息,请参阅支持的诊断遥测For more information, see supported diagnostic telemetry.

托管实例的资源使用情况统计信息Resource usage stats for managed instances

属性Property 说明Description
TenantIdTenantId 租户 IDYour tenant ID
SourceSystemSourceSystem 始终:AzureAlways: Azure
TimeGenerated [UTC]TimeGenerated [UTC] 记录日志时的时间戳Time stamp when the log was recorded
类型Type 始终:AzureDiagnosticsAlways: AzureDiagnostics
ResourceProviderResourceProvider 资源提供程序的名称。Name of the resource provider. 始终:MICROSOFT.SQLAlways: MICROSOFT.SQL
CategoryCategory 类别的名称。Name of the category. 始终:ResourceUsageStatsAlways: ResourceUsageStats
资源Resource 资源名称Name of the resource
ResourceTypeResourceType 资源类型的名称。Name of the resource type. 始终:MANAGEDINSTANCESAlways: MANAGEDINSTANCES
SubscriptionIdSubscriptionId 数据库的订阅 GUIDSubscription GUID for the database
resourceGroupResourceGroup 数据库的资源组名称Name of the resource group for the database
LogicalServerName_sLogicalServerName_s 托管实例的名称Name of the managed instance
ResourceIdResourceId 资源 URIResource URI
SKU_sSKU_s SQL 托管实例产品 SKUSQL Managed Instance product SKU
virtual_core_count_svirtual_core_count_s 可用 vCore 的数目Number of vCores available
avg_cpu_percent_savg_cpu_percent_s CPU 平均百分比Average CPU percentage
reserved_storage_mb_sreserved_storage_mb_s 托管实例上的保留存储容量Reserved storage capacity on the managed instance
storage_space_used_mb_sstorage_space_used_mb_s 托管实例上的已用存储Used storage on the managed instance
io_requests_sio_requests_s IOPS 计数IOPS count
io_bytes_read_sio_bytes_read_s 已读取的 IOPS 字节数IOPS bytes read
io_bytes_written_sio_bytes_written_s 已写入的 IOPS 字节数IOPS bytes written

查询数据存储运行时统计信息Query Store runtime statistics

属性Property 说明Description
TenantIdTenantId 租户 IDYour tenant ID
SourceSystemSourceSystem 始终:AzureAlways: Azure
TimeGenerated [UTC]TimeGenerated [UTC] 记录日志时的时间戳Time stamp when the log was recorded
类型Type 始终:AzureDiagnosticsAlways: AzureDiagnostics
ResourceProviderResourceProvider 资源提供程序的名称。Name of the resource provider. 始终:MICROSOFT.SQLAlways: MICROSOFT.SQL
CategoryCategory 类别的名称。Name of the category. 始终:QueryStoreRuntimeStatisticsAlways: QueryStoreRuntimeStatistics
OperationNameOperationName 操作的名称。Name of the operation. 始终:QueryStoreRuntimeStatisticsEventAlways: QueryStoreRuntimeStatisticsEvent
资源Resource 资源名称Name of the resource
ResourceTypeResourceType 资源类型的名称。Name of the resource type. 始终:SERVERS/DATABASESAlways: SERVERS/DATABASES
SubscriptionIdSubscriptionId 数据库的订阅 GUIDSubscription GUID for the database
resourceGroupResourceGroup 数据库的资源组名称Name of the resource group for the database
LogicalServerName_sLogicalServerName_s 数据库的服务器名称Name of the server for the database
ElasticPoolName_sElasticPoolName_s 数据库的弹性池(如果有)名称Name of the elastic pool for the database, if any
DatabaseName_sDatabaseName_s 数据库的名称Name of the database
ResourceIdResourceId 资源 URIResource URI
query_hash_squery_hash_s 查询哈希Query hash
query_plan_hash_squery_plan_hash_s 查询计划哈希Query plan hash
statement_sql_handle_sstatement_sql_handle_s 语句 SQL 句柄Statement sql handle
interval_start_time_dinterval_start_time_d 间隔的开始 datetimeoffset,以从 1900-1-1 开始的时钟周期数计Start datetimeoffset of the interval in number of ticks from 1900-1-1
interval_end_time_dinterval_end_time_d 间隔的结束 datetimeoffset,以从 1900-1-1 开始的时钟周期数计End datetimeoffset of the interval in number of ticks from 1900-1-1
logical_io_writes_dlogical_io_writes_d 逻辑 IO 写入总次数Total number of logical IO writes
max_logical_io_writes_dmax_logical_io_writes_d 每次执行逻辑 IO 写入的最大次数Max number of logical IO writes per execution
physical_io_reads_dphysical_io_reads_d 物理 IO 读取总次数Total number of physical IO reads
max_physical_io_reads_dmax_physical_io_reads_d 每次执行逻辑 IO 读取的最大次数Max number of logical IO reads per execution
logical_io_reads_dlogical_io_reads_d 逻辑 IO 读取总次数Total number of logical IO reads
max_logical_io_reads_dmax_logical_io_reads_d 每次执行逻辑 IO 读取的最大次数Max number of logical IO reads per execution
execution_type_dexecution_type_d 执行类型Execution type
count_executions_dcount_executions_d 执行查询的次数Number of executions of the query
cpu_time_dcpu_time_d 查询使用的总 CPU 时间(以微秒为单位)Total CPU time consumed by the query in microseconds
max_cpu_time_dmax_cpu_time_d 单个执行消耗的最大 CPU 时间(以微秒为单位)Max CPU time consumer by a single execution in microseconds
dop_ddop_d 并行度总和Sum of degrees of parallelism
max_dop_dmax_dop_d 用于单个执行的最大并行度Max degree of parallelism used for single execution
rowcount_drowcount_d 返回的总行数Total number of rows returned
max_rowcount_dmax_rowcount_d 单个执行中返回的最大行数Max number of rows returned in single execution
query_max_used_memory_dquery_max_used_memory_d 已使用的内存总量(以 KB 为单位)Total amount of memory used in KB
max_query_max_used_memory_dmax_query_max_used_memory_d 单个执行使用的最大内存量(以 KB 为单位)Max amount of memory used by a single execution in KB
duration_dduration_d 总执行时间(以微秒为单位)Total execution time in microseconds
max_duration_dmax_duration_d 单个执行的最大执行时间Max execution time of a single execution
num_physical_io_reads_dnum_physical_io_reads_d 总物理读取次数Total number of physical reads
max_num_physical_io_reads_dmax_num_physical_io_reads_d 每次执行最大物理读取次数Max number of physical reads per execution
log_bytes_used_dlog_bytes_used_d 使用的日志字节总量Total amount of log bytes used
max_log_bytes_used_dmax_log_bytes_used_d 每次执行使用的日志字节最大数量Max amount of log bytes used per execution
query_id_dquery_id_d 查询存储中查询的 IDID of the query in Query Store
plan_id_dplan_id_d 查询存储中计划的 IDID of the plan in Query Store

详细了解查询存储运行时统计信息数据Learn more about Query Store runtime statistics data.

查询存储等待统计信息Query Store wait statistics

属性Property 说明Description
TenantIdTenantId 租户 IDYour tenant ID
SourceSystemSourceSystem 始终:AzureAlways: Azure
TimeGenerated [UTC]TimeGenerated [UTC] 记录日志时的时间戳Time stamp when the log was recorded
类型Type 始终:AzureDiagnosticsAlways: AzureDiagnostics
ResourceProviderResourceProvider 资源提供程序的名称。Name of the resource provider. 始终:MICROSOFT.SQLAlways: MICROSOFT.SQL
CategoryCategory 类别的名称。Name of the category. 始终:QueryStoreWaitStatisticsAlways: QueryStoreWaitStatistics
OperationNameOperationName 操作的名称。Name of the operation. 始终:QueryStoreWaitStatisticsEventAlways: QueryStoreWaitStatisticsEvent
资源Resource 资源名称Name of the resource
ResourceTypeResourceType 资源类型的名称。Name of the resource type. 始终:SERVERS/DATABASESAlways: SERVERS/DATABASES
SubscriptionIdSubscriptionId 数据库的订阅 GUIDSubscription GUID for the database
resourceGroupResourceGroup 数据库的资源组名称Name of the resource group for the database
LogicalServerName_sLogicalServerName_s 数据库的服务器名称Name of the server for the database
ElasticPoolName_sElasticPoolName_s 数据库的弹性池(如果有)名称Name of the elastic pool for the database, if any
DatabaseName_sDatabaseName_s 数据库的名称Name of the database
ResourceIdResourceId 资源 URIResource URI
wait_category_swait_category_s 等待的类别Category of the wait
is_parameterizable_sis_parameterizable_s 查询是否可以参数化Is the query parameterizable
statement_type_sstatement_type_s 语句的类型Type of the statement
statement_key_hash_sstatement_key_hash_s 语句密钥哈希Statement key hash
exec_type_dexec_type_d 执行类型Type of execution
total_query_wait_time_ms_dtotal_query_wait_time_ms_d 查询特定等待类别的总等待时间Total wait time of the query on the specific wait category
max_query_wait_time_ms_dmax_query_wait_time_ms_d 单个执行中针对具体等待类别的查询的最大等待时间Max wait time of the query in individual execution on the specific wait category
query_param_type_dquery_param_type_d 00
query_hash_squery_hash_s 查询存储中的查询哈希Query hash in Query Store
query_plan_hash_squery_plan_hash_s 查询存储中的查询计划哈希。Query plan hash in Query Store
statement_sql_handle_sstatement_sql_handle_s 查询存储中的语句句柄Statement handle in Query Store
interval_start_time_dinterval_start_time_d 间隔的开始 datetimeoffset,以从 1900-1-1 开始的时钟周期数计Start datetimeoffset of the interval in number of ticks from 1900-1-1
interval_end_time_dinterval_end_time_d 间隔的结束 datetimeoffset,以从 1900-1-1 开始的时钟周期数计End datetimeoffset of the interval in number of ticks from 1900-1-1
count_executions_dcount_executions_d 执行查询的次数Count of executions of the query
query_id_dquery_id_d 查询存储中查询的 IDID of the query in Query Store
plan_id_dplan_id_d 查询存储中计划的 IDID of the plan in Query Store

详细了解查询存储等待统计数据Learn more about Query Store wait statistics data.

错误数据集Errors dataset

属性Property 说明Description
TenantIdTenantId 租户 IDYour tenant ID
SourceSystemSourceSystem 始终:AzureAlways: Azure
TimeGenerated [UTC]TimeGenerated [UTC] 记录日志时的时间戳Time stamp when the log was recorded
类型Type 始终:AzureDiagnosticsAlways: AzureDiagnostics
ResourceProviderResourceProvider 资源提供程序的名称。Name of the resource provider. 始终:MICROSOFT.SQLAlways: MICROSOFT.SQL
CategoryCategory 类别的名称。Name of the category. 始终:错误Always: Errors
OperationNameOperationName 操作的名称。Name of the operation. 始终:ErrorEventAlways: ErrorEvent
资源Resource 资源名称Name of the resource
ResourceTypeResourceType 资源类型的名称。Name of the resource type. 始终:SERVERS/DATABASESAlways: SERVERS/DATABASES
SubscriptionIdSubscriptionId 数据库的订阅 GUIDSubscription GUID for the database
resourceGroupResourceGroup 数据库的资源组名称Name of the resource group for the database
LogicalServerName_sLogicalServerName_s 数据库的服务器名称Name of the server for the database
ElasticPoolName_sElasticPoolName_s 数据库的弹性池(如果有)名称Name of the elastic pool for the database, if any
DatabaseName_sDatabaseName_s 数据库的名称Name of the database
ResourceIdResourceId 资源 URIResource URI
MessageMessage 纯文本格式的错误消息Error message in plain text
user_defined_buser_defined_b 是否是用户定义位错误Is the error user defined bit
error_number_derror_number_d 错误代码Error code
severitySeverity 错误的严重性Severity of the error
state_dstate_d 错误的状态State of the error
query_hash_squery_hash_s 失败查询的查询哈希(如果有)Query hash of the failed query, if available
query_plan_hash_squery_plan_hash_s 失败查询的查询计划哈希(如果有)Query plan hash of the failed query, if available

详细了解 SQL 错误消息Learn more about SQL error messages.

数据库等待统计数据集Database wait statistics dataset

属性Property 说明Description
TenantIdTenantId 租户 IDYour tenant ID
SourceSystemSourceSystem 始终:AzureAlways: Azure
TimeGenerated [UTC]TimeGenerated [UTC] 记录日志时的时间戳Time stamp when the log was recorded
类型Type 始终:AzureDiagnosticsAlways: AzureDiagnostics
ResourceProviderResourceProvider 资源提供程序的名称。Name of the resource provider. 始终:MICROSOFT.SQLAlways: MICROSOFT.SQL
CategoryCategory 类别的名称。Name of the category. 始终:DatabaseWaitStatisticsAlways: DatabaseWaitStatistics
OperationNameOperationName 操作的名称。Name of the operation. 始终:DatabaseWaitStatisticsEventAlways: DatabaseWaitStatisticsEvent
资源Resource 资源名称Name of the resource
ResourceTypeResourceType 资源类型的名称。Name of the resource type. 始终:SERVERS/DATABASESAlways: SERVERS/DATABASES
SubscriptionIdSubscriptionId 数据库的订阅 GUIDSubscription GUID for the database
resourceGroupResourceGroup 数据库的资源组名称Name of the resource group for the database
LogicalServerName_sLogicalServerName_s 数据库的服务器名称Name of the server for the database
ElasticPoolName_sElasticPoolName_s 数据库的弹性池(如果有)名称Name of the elastic pool for the database, if any
DatabaseName_sDatabaseName_s 数据库的名称Name of the database
ResourceIdResourceId 资源 URIResource URI
wait_type_swait_type_s 等待类型的名称Name of the wait type
start_utc_date_t [UTC]start_utc_date_t [UTC] 测量周期开始时间Measured period start time
end_utc_date_t [UTC]end_utc_date_t [UTC] 测量周期结束时间Measured period end time
delta_max_wait_time_ms_ddelta_max_wait_time_ms_d 每次执行最大等待时间Max waited time per execution
delta_signal_wait_time_ms_ddelta_signal_wait_time_ms_d 总信号等待时间Total signals wait time
delta_wait_time_ms_ddelta_wait_time_ms_d 期间内的总等待时间Total wait time in the period
delta_waiting_tasks_count_ddelta_waiting_tasks_count_d 等待任务数Number of waiting tasks

详细了解数据库等待统计信息Learn more about database wait statistics.

超时数据集Time-outs dataset

属性Property 说明Description
TenantIdTenantId 租户 IDYour tenant ID
SourceSystemSourceSystem 始终:AzureAlways: Azure
TimeGenerated [UTC]TimeGenerated [UTC] 记录日志时的时间戳Time stamp when the log was recorded
类型Type 始终:AzureDiagnosticsAlways: AzureDiagnostics
ResourceProviderResourceProvider 资源提供程序的名称。Name of the resource provider. 始终:MICROSOFT.SQLAlways: MICROSOFT.SQL
CategoryCategory 类别的名称。Name of the category. 始终:超时Always: Timeouts
OperationNameOperationName 操作的名称。Name of the operation. 始终:TimeoutEventAlways: TimeoutEvent
资源Resource 资源名称Name of the resource
ResourceTypeResourceType 资源类型的名称。Name of the resource type. 始终:SERVERS/DATABASESAlways: SERVERS/DATABASES
SubscriptionIdSubscriptionId 数据库的订阅 GUIDSubscription GUID for the database
resourceGroupResourceGroup 数据库的资源组名称Name of the resource group for the database
LogicalServerName_sLogicalServerName_s 数据库的服务器名称Name of the server for the database
ElasticPoolName_sElasticPoolName_s 数据库的弹性池(如果有)名称Name of the elastic pool for the database, if any
DatabaseName_sDatabaseName_s 数据库的名称Name of the database
ResourceIdResourceId 资源 URIResource URI
error_state_derror_state_d 错误状态代码Error state code
query_hash_squery_hash_s 查询哈希(如果有)Query hash, if available
query_plan_hash_squery_plan_hash_s 查询计划哈希(如果有)Query plan hash, if available

阻塞数据集Blockings dataset

属性Property 说明Description
TenantIdTenantId 租户 IDYour tenant ID
SourceSystemSourceSystem 始终:AzureAlways: Azure
TimeGenerated [UTC]TimeGenerated [UTC] 记录日志时的时间戳Time stamp when the log was recorded
类型Type 始终:AzureDiagnosticsAlways: AzureDiagnostics
ResourceProviderResourceProvider 资源提供程序的名称。Name of the resource provider. 始终:MICROSOFT.SQLAlways: MICROSOFT.SQL
CategoryCategory 类别的名称。Name of the category. 始终:块Always: Blocks
OperationNameOperationName 操作的名称。Name of the operation. 始终:BlockEventAlways: BlockEvent
资源Resource 资源名称Name of the resource
ResourceTypeResourceType 资源类型的名称。Name of the resource type. 始终:SERVERS/DATABASESAlways: SERVERS/DATABASES
SubscriptionIdSubscriptionId 数据库的订阅 GUIDSubscription GUID for the database
resourceGroupResourceGroup 数据库的资源组名称Name of the resource group for the database
LogicalServerName_sLogicalServerName_s 数据库的服务器名称Name of the server for the database
ElasticPoolName_sElasticPoolName_s 数据库的弹性池(如果有)名称Name of the elastic pool for the database, if any
DatabaseName_sDatabaseName_s 数据库的名称Name of the database
ResourceIdResourceId 资源 URIResource URI
lock_mode_slock_mode_s 查询所使用的锁模式Lock mode used by the query
resource_owner_type_sresource_owner_type_s 锁的所有者Owner of the lock
blocked_process_filtered_sblocked_process_filtered_s 阻塞进程报告 XMLBlocked process report XML
duration_dduration_d 锁定持续时间(以毫秒为单位)Duration of the lock in microseconds

死锁数据集Deadlocks dataset

属性Property 说明Description
TenantIdTenantId 租户 IDYour tenant ID
SourceSystemSourceSystem 始终:AzureAlways: Azure
TimeGenerated [UTC]TimeGenerated [UTC] 记录日志时的时间戳Time stamp when the log was recorded
类型Type 始终:AzureDiagnosticsAlways: AzureDiagnostics
ResourceProviderResourceProvider 资源提供程序的名称。Name of the resource provider. 始终:MICROSOFT.SQLAlways: MICROSOFT.SQL
CategoryCategory 类别的名称。Name of the category. 始终:死锁数Always: Deadlocks
OperationNameOperationName 操作的名称。Name of the operation. 始终:DeadlockEventAlways: DeadlockEvent
资源Resource 资源名称Name of the resource
ResourceTypeResourceType 资源类型的名称。Name of the resource type. 始终:SERVERS/DATABASESAlways: SERVERS/DATABASES
SubscriptionIdSubscriptionId 数据库的订阅 GUIDSubscription GUID for the database
resourceGroupResourceGroup 数据库的资源组名称Name of the resource group for the database
LogicalServerName_sLogicalServerName_s 数据库的服务器名称Name of the server for the database
ElasticPoolName_sElasticPoolName_s 数据库的弹性池(如果有)名称Name of the elastic pool for the database, if any
DatabaseName_sDatabaseName_s 数据库的名称Name of the database
ResourceIdResourceId 资源 URIResource URI
deadlock_xml_sdeadlock_xml_s 死锁报告 XMLDeadlock report XML

自动优化数据集Automatic tuning dataset

属性Property 说明Description
TenantIdTenantId 租户 IDYour tenant ID
SourceSystemSourceSystem 始终:AzureAlways: Azure
TimeGenerated [UTC]TimeGenerated [UTC] 记录日志时的时间戳Time stamp when the log was recorded
类型Type 始终:AzureDiagnosticsAlways: AzureDiagnostics
ResourceProviderResourceProvider 资源提供程序的名称。Name of the resource provider. 始终:MICROSOFT.SQLAlways: MICROSOFT.SQL
CategoryCategory 类别的名称。Name of the category. 始终:AutomaticTuningAlways: AutomaticTuning
资源Resource 资源名称Name of the resource
ResourceTypeResourceType 资源类型的名称。Name of the resource type. 始终:SERVERS/DATABASESAlways: SERVERS/DATABASES
SubscriptionIdSubscriptionId 数据库的订阅 GUIDSubscription GUID for the database
resourceGroupResourceGroup 数据库的资源组名称Name of the resource group for the database
LogicalServerName_sLogicalServerName_s 数据库的服务器名称Name of the server for the database
LogicalDatabaseName_sLogicalDatabaseName_s 数据库的名称Name of the database
ElasticPoolName_sElasticPoolName_s 数据库的弹性池(如果有)名称Name of the elastic pool for the database, if any
DatabaseName_sDatabaseName_s 数据库的名称Name of the database
ResourceIdResourceId 资源 URIResource URI
RecommendationHash_sRecommendationHash_s 自动优化建议的唯一哈希值Unique hash of Automatic tuning recommendation
OptionName_sOptionName_s 自动优化操作Automatic tuning operation
Schema_sSchema_s 数据库架构Database schema
Table_sTable_s 受影响的表Table affected
IndexName_sIndexName_s 索引名称Index name
IndexColumns_sIndexColumns_s 列名称Column name
IncludedColumns_sIncludedColumns_s 包括的列Columns included
EstimatedImpact_sEstimatedImpact_s 自动优化建议 JSON 的估计影响Estimated impact of Automatic tuning recommendation JSON
Event_sEvent_s 自动优化事件的类型Type of Automatic tuning event
Timestamp_tTimestamp_t 上次更新时间戳Last updated timestamp

智能见解数据集Intelligent Insights dataset

详细了解 Intelligent Insights 日志格式Learn more about the Intelligent Insights log format.

后续步骤Next steps

若要了解如何启用日志记录并了解各种 Azure 服务支持的指标和日志类别,请参阅:To learn how to enable logging and to understand the metrics and log categories supported by the various Azure services, see:

若要了解事件中心,请阅读以下主题:To learn about Event Hubs, read: