你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Azure 事件中心监视数据参考

本文包含此服务的所有监视参考信息。

请参阅监视 Azure 事件中心,详细了解可为 Azure 事件中心收集的数据以及如何使用这些数据。

Azure Event Hubs creates monitoring data using Azure Monitor, which is a full stack monitoring service in Azure. Azure Monitor 提供了一组用于监视 Azure 资源的完整功能。 它还可以监视其他云和本地的资源。

Azure 事件中心收集与监视 Azure 资源中的数据中所述的其他 Azure 资源相同的监视数据。

Metrics

本部分列出了为此服务自动收集的所有平台指标。 这些指标也是 Azure Monitor 中支持的所有平台指标的全局列表的一部分。

有关指标保留的信息,请参阅 Azure Monitor 指标概述

Microsoft.EventHub/clusters 支持的指标

下表列出了可用于 Microsoft.EventHub/clusters 资源类型的指标。

  • 并非所有列都显示在每个表中。
  • 某些列可能超出了页面的查看区域。 Select Expand table to view all available columns.

Table headings

  • Category - The metrics group or classification.
  • Metric - The metric display name as it appears in the Azure portal.
  • REST API 中的名称 - 在 REST API 中引用的指标名称。
  • Unit - Unit of measure.
  • Aggregation - The default aggregation type. 有效值:平均值(平均)、最小值(最小值)、最大值(最大值)、总计(总和)、计数。
  • Dimensions - Dimensions available for the metric.
  • Time Grains - Intervals at which the metric is sampled. 例如,PT1M 表示该指标每分钟采样一次,PT30M 表示每 30 分钟一次,PT1H 表示每小时一次,以此类推。
  • DS Export- Whether the metric is exportable to Azure Monitor Logs via diagnostic settings. 要了解如何导出指标的信息,请参阅在 Azure Monitor 中创建诊断设置
Metric REST API 中的名称 Unit Aggregation Dimensions Time Grains DS Export
ActiveConnections

Microsoft.EventHub 的活动连接总数。
ActiveConnections Count Average <无> PT1M No
Available Memory

事件中心群集的可用内存,以总内存量的百分比表示。
AvailableMemory Percent Maximum Role PT1M No
Capture Backlog.

捕获有关 Microsoft.EventHub 的积压工作(backlog)。
CaptureBacklog Count Total (Sum) <无> PT1M No
Captured Bytes.

Microsoft.EventHub 已捕获的字节数。
CapturedBytes Bytes Total (Sum) <无> PT1M No
Captured Messages.

Microsoft.EventHub 已捕获的消息数。
CapturedMessages Count Total (Sum) <无> PT1M No
Connections Closed.

Microsoft.EventHub 已关闭的连接数。
ConnectionsClosed Count Average <无> PT1M No
Connections Opened.

Microsoft.EventHub 打开的连接数。
ConnectionsOpened Count Average <无> PT1M No
CPU

事件中心群集的 CPU 使用率(百分比)
CPU Percent Maximum Role PT1M No
Incoming Bytes.

Microsoft.EventHub 传入的字节数。
IncomingBytes Bytes Total (Sum) <无> PT1M Yes
Incoming Messages

Microsoft.EventHub 传入的消息数。
IncomingMessages Count Total (Sum) <无> PT1M Yes
Incoming Requests

Microsoft.EventHub 传入的请求数。
IncomingRequests Count Total (Sum) <无> PT1M Yes
Outgoing Bytes.

Microsoft.EventHub 传出的字节数。
OutgoingBytes Bytes Total (Sum) <无> PT1M Yes
Outgoing Messages

Microsoft.EventHub 传出的消息数。
OutgoingMessages Count Total (Sum) <无> PT1M Yes
超出配额的错误数。

Microsoft.EventHub 的超过限额错误数。
QuotaExceededErrors Count Total (Sum) OperationResult PT1M No
Server Errors.

Microsoft.EventHub 的服务器错误数。
ServerErrors Count Total (Sum) OperationResult PT1M No
Size

EventHub 的大小(以字节为单位)。
Size Bytes 平均值、最小值、最大值 Role PT1M No
Successful Requests

Microsoft.EventHub 成功请求数。
SuccessfulRequests Count Total (Sum) OperationResult PT1M No
Throttled Requests.

Microsoft.EventHub 限制的请求数。
ThrottledRequests Count Total (Sum) OperationResult PT1M No
User Errors.

Microsoft.EventHub 用户错误数。
UserErrors Count Total (Sum) OperationResult PT1M No

Microsoft.EventHub/Namespaces 支持的指标

下表列出了可用于 Microsoft.EventHub/Namespaces 资源类型的指标。

  • 并非所有列都显示在每个表中。
  • 某些列可能超出了页面的查看区域。 Select Expand table to view all available columns.

Table headings

  • Category - The metrics group or classification.
  • Metric - The metric display name as it appears in the Azure portal.
  • REST API 中的名称 - 在 REST API 中引用的指标名称。
  • Unit - Unit of measure.
  • Aggregation - The default aggregation type. 有效值:平均值(平均)、最小值(最小值)、最大值(最大值)、总计(总和)、计数。
  • Dimensions - Dimensions available for the metric.
  • Time Grains - Intervals at which the metric is sampled. 例如,PT1M 表示该指标每分钟采样一次,PT30M 表示每 30 分钟一次,PT1H 表示每小时一次,以此类推。
  • DS Export- Whether the metric is exportable to Azure Monitor Logs via diagnostic settings. 要了解如何导出指标的信息,请参阅在 Azure Monitor 中创建诊断设置
Metric REST API 中的名称 Unit Aggregation Dimensions Time Grains DS Export
ActiveConnections

Microsoft.EventHub 的活动连接总数。
ActiveConnections Count 最大值、最小值、平均值 <无> PT1M No
Capture Backlog.

要为 Microsoft.EventHub 捕获的字节积压工作。
CaptureBacklog Count Total (Sum) EntityName PT1M No
Captured Bytes.

Microsoft.EventHub 已捕获的字节数。
CapturedBytes Bytes Total (Sum) EntityName PT1M No
Captured Messages.

Microsoft.EventHub 已捕获的消息数。
CapturedMessages Count Total (Sum) EntityName PT1M No
Connections Closed.

Microsoft.EventHub 已关闭的连接数。
ConnectionsClosed Count Maximum EntityName PT1M No
Connections Opened.

Microsoft.EventHub 打开的连接数。
ConnectionsOpened Count Maximum EntityName PT1M No
存档积压工作消息数(已弃用)

命名空间积压工作中的事件中心存档消息数(已弃用)
EHABL Count Total (Sum) <无> PT1M Yes
存档消息吞吐量(已弃用)

命名空间中的事件中心存档消息吞吐量(已弃用)
EHAMBS Bytes Total (Sum) <无> PT1M Yes
存档消息数(已弃用)

命名空间中的事件中心存档消息数(已弃用)
EHAMSGS Count Total (Sum) <无> PT1M Yes
传入字节数(已弃用)

命名空间的事件中心传入消息吞吐量(已弃用)
EHINBYTES Bytes Total (Sum) <无> PT1M Yes
传入字节数(已过时)(已弃用)

命名空间的事件中心传入消息吞吐量。 此指标已弃用。 请改用传入字节指标(已弃用)
EHINMBS Bytes Total (Sum) <无> PT1M Yes
传入消息数(已弃用)

命名空间的传入消息总数(已弃用)
EHINMSGS Count Total (Sum) <无> PT1M Yes
传出字节数(已弃用)

命名空间的事件中心传出消息吞吐量(已弃用)
EHOUTBYTES Bytes Total (Sum) <无> PT1M Yes
传出字节数(已过时)(已弃用)

命名空间的事件中心传出消息吞吐量。 此指标已弃用。 请改用传出字节指标(已弃用)
EHOUTMBS Bytes Total (Sum) <无> PT1M Yes
传出消息数(已弃用)

命名空间的传出消息总数(已弃用)
EHOUTMSGS Count Total (Sum) <无> PT1M Yes
失败的请求数(已弃用)

命名空间的失败请求总数(已弃用)
FAILREQ Count Total (Sum) <无> PT1M Yes
Incoming Bytes.

Microsoft.EventHub 传入的字节数。
IncomingBytes Bytes Total (Sum) EntityName PT1M Yes
Incoming Messages

Microsoft.EventHub 传入的消息数。
IncomingMessages Count Total (Sum) EntityName PT1M Yes
Incoming Requests

Microsoft.EventHub 传入的请求数。
IncomingRequests Count Total (Sum) EntityName PT1M Yes
传入的消息数(已过时)(已弃用)

命名空间的传入消息总数。 此指标已弃用。 请改用传入消息指标(已弃用)
INMSGS Count Total (Sum) <无> PT1M Yes
传入的请求数(已弃用)

命名空间的传入发送请求总数(已弃用)
INREQS Count Total (Sum) <无> PT1M Yes
内部服务器错误数(已弃用)

命名空间的内部服务器错误总数(已弃用)
INTERR Count Total (Sum) <无> PT1M Yes
其他错误数(已弃用)

命名空间的失败请求总数(已弃用)
MISCERR Count Total (Sum) <无> PT1M Yes
CPU

高级 SKU 命名空间的 CPU 使用指标。
NamespaceCpuUsage Percent 最大值、最小值、平均值 Replica PT1M No
Memory Usage

高级 SKU 命名空间的内存使用指标。
NamespaceMemoryUsage Percent 最大值、最小值、平均值 Replica PT1M No
Outgoing Bytes.

Microsoft.EventHub 传出的字节数。
OutgoingBytes Bytes Total (Sum) EntityName PT1M Yes
Outgoing Messages

Microsoft.EventHub 传出的消息数。
OutgoingMessages Count Total (Sum) EntityName PT1M Yes
传出的消息数(已过时)(已弃用)

命名空间的传出消息总数。 此指标已弃用。 请改用传出消息指标(已弃用)
OUTMSGS Count Total (Sum) <无> PT1M Yes
超出配额的错误数。

Microsoft.EventHub 的超过限额错误数。
QuotaExceededErrors Count Total (Sum) EntityNameOperationResult PT1M No
ReplicationLagCount

复制滞后时间(按消息计数)
ReplicationLagCount Count 最大值、最小值、平均值 EntityName PT1M No
ReplicationLagDuration

复制滞后时间(按持续时间)
ReplicationLagDuration Seconds 最大值、最小值、平均值 EntityName PT1M Yes
Server Errors.

Microsoft.EventHub 的服务器错误数。
ServerErrors Count Total (Sum) EntityNameOperationResult PT1M No
Size

EventHub 的大小(以字节为单位)。
Size Bytes 平均值、最小值、最大值 EntityName PT1M No
Successful Requests

Microsoft.EventHub 成功请求数。
SuccessfulRequests Count Total (Sum) EntityNameOperationResult PT1M No
成功的请求数(已弃用)

命名空间的成功请求总数(已弃用)
SUCCREQ Count Total (Sum) <无> PT1M Yes
服务器繁忙错误数(已弃用)

命名空间的服务器繁忙错误总数(已弃用)
SVRBSY Count Total (Sum) <无> PT1M Yes
Throttled Requests.

Microsoft.EventHub 限制的请求数。
ThrottledRequests Count Total (Sum) EntityNameOperationResult PT1M No
User Errors.

Microsoft.EventHub 用户错误数。
UserErrors Count Total (Sum) EntityNameOperationResult PT1M No

以下表格列出了为 Azure 事件中心自动收集的所有平台指标。 这些指标的资源提供程序是 Microsoft.EventHub/clustersMicrosoft.EventHub/namespaces

Request metrics count the number of data and management operations requests. 此表提供有关上述表中的值的详细信息。

Metric name Description
Incoming Requests 在指定时间段内向事件中心服务发送的请求的数量。 该指标包括所有数据和管理平面操作。
Successful Requests 在指定时间段内向事件中心服务成功发送的请求的数量。
Throttled Requests 由于使用量超标,而被限制的请求数。

此表提供了有关上表中的消息指标的更多信息。

Metric name Description
Incoming Messages 在指定期间内发送到事件中心的事件或邮件数。
Outgoing Messages 在指定时间段内从事件中心接收的事件或消息的数量。
Captured Messages 所捕获消息的数量。
Incoming Bytes 在指定时间段内事件中心的传入字节数。
Outgoing Bytes 在指定时间段内事件中心的传出字节数。
Size 事件中心的大小(以字节为单位)。

Note

  • 这些值是时间点值。 在该时间点之后立即使用的传入消息可能不会反映在这些指标中。
  • “传入请求数”指标包括所有数据和管理平面操作。 “传入消息数”指标提供发送到事件中心的事件总数。 例如,如果向事件中心发送一批事件(100 个),则算作 1 个传入请求和 100 条传入消息。

该表提供了有关前述表格中的捕获指标的更多信息。

Metric name Description
Captured Messages 所捕获消息的数量。
Captured Bytes 事件中心的捕获字节数。
Capture Backlog 事件中心捕获积压工作的数量。

该表提供了有关前述表格中的连接指标的更多信息。

Metric name Description
Active Connections 命名空间上及其中实体(事件中心)上的活动连接数。 此指标的值为时间点值。 在该时间点之后立即处于活动状态的连接可能不会反映在这些指标中。
Connections Opened 打开的连接数。
Connections Closed 关闭的连接数。

该表提供了有关前述表格中的错误指标的更多信息。

Metric name Description
Server Errors 在指定时间段内,因事件中心服务错误未处理的请求的数量。
User Errors 由于存在用户错误,在指定期间内未处理的请求数。
超过配额错误 在指定时间段内超出配额所导致错误的数量。

The following two types of errors are classified as user errors:

  1. 客户端错误(在 HTTP 中为 400 错误)。
  2. 处理消息时发生的错误。

Note

逻辑应用会创建 epoch 接收器。 可以根据服务负载将接收器从一个节点移到另一个节点。 在这些移动过程中,可能会发生 ReceiverDisconnection 异常。 它们被计为事件中心服务端的用户错误。 逻辑应用会从事件中心客户端收集故障,让你可以在用户日志中查看它们。

Metric dimensions

For information about what metric dimensions are, see Multi-dimensional metrics.

此服务具有以下与其指标关联的维度。

Dimension name Description
EntityName 事件中心的名称。 使用“传入请求”指标时,除了所有事件中心外,“实体名称”维度还具有 -NamespaceOnlyMetric- 值。 它表示在命名空间级别发出的请求。 示例包括列出命名空间下所有事件中心的请求,或对身份验证或授权失败的实体的请求。
OperationResult 指示 success 或相应的错误状态,例如 serverbusyclienterrorquotaexceeded

为指标添加维度是可选的。 如果不添加维度,则指标是在命名空间级别指定的。

Note

启用诊断设置中的指标时,当前发送到存储帐户、事件中心或 Log Analytics 的信息中并不包含维度信息。

Resource logs

本部分列出了可为此服务收集的资源日志类型。 本部分拉取自 Azure Monitor 支持的所有资源日志类别类型列表。

Microsoft.EventHub/Namespaces 支持的资源日志

Category 类别显示名称 Log table 支持基本日志计划 支持引入时间转换 Example queries 导出成本
ApplicationMetricsLogs 应用程序指标日志 AzureDiagnostics

来自多个 Azure 资源的日志。

No No Queries Yes
ArchiveLogs Archive Logs AzureDiagnostics

来自多个 Azure 资源的日志。

No No Queries No
AutoScaleLogs 自动缩放日志 AzureDiagnostics

来自多个 Azure 资源的日志。

No No Queries No
CustomerManagedKeyUserLogs 客户管理的密钥日志 AzureDiagnostics

来自多个 Azure 资源的日志。

No No Queries No
DataDRLogs DataDR Logs AzureDiagnostics

来自多个 Azure 资源的日志。

No No Queries Yes
DiagnosticErrorLogs 诊断错误日志 AzureDiagnostics

来自多个 Azure 资源的日志。

No No Queries Yes
EventHubVNetConnectionEvent VNet/IP 筛选连接日志 AzureDiagnostics

来自多个 Azure 资源的日志。

No No Queries No
KafkaCoordinatorLogs Kafka 协调器日志 AzureDiagnostics

来自多个 Azure 资源的日志。

No No Queries No
KafkaUserErrorLogs Kafka 用户错误日志 AzureDiagnostics

来自多个 Azure 资源的日志。

No No Queries No
OperationalLogs Operational Logs AzureDiagnostics

来自多个 Azure 资源的日志。

No No Queries No
RuntimeAuditLogs 运行时审核日志 AzureDiagnostics

来自多个 Azure 资源的日志。

No No Queries Yes

Azure Monitor 日志表

本部分列出了与此服务相关的 Azure Monitor 日志表,日志分析可使用 Kusto 查询来查询这些表。 这些表包含资源日志数据,此外还可能包含其他数据,具体取决于所收集并路由到这些表的内容。

事件中心 Microsoft.EventHub/namespaces

事件中心资源日志

Azure 事件中心现在能够将日志调度到两个目标表之一 - Azure 诊断表或 Log Analytics 中特定于资源的表。 可以使用 Azure 门户上提供的切换按钮来选择目标表。

用于设置目标表的对话框的屏幕截图。

Azure 事件中心使用 Azure Monitor 日志中的 Kusto 表。 你可以通过 Log Analytics 查询这些表。

可以查看我们的示例查询,以开始使用不同的日志类别。

Important

系统不会将维度导出到 Log Analytics 工作区。

事件中心会捕获以下类别的诊断日志:

Category Description
Archive Logs 捕获有关事件中心捕获操作的信息,特别是与捕获错误相关的日志。
Operational Logs 捕获在 Azure 事件中心命名空间中执行的所有管理操作。 由于在 Azure 事件中心进行的数据操作量较大,因此不会捕获数据操作。
自动缩放日志 捕获对事件中心命名空间执行的自动膨胀作。
Kafka 协调器日志 捕获与事件中心相关的 Kafka 协调器操作。
Kafka 用户错误日志 捕获事件中心中调用的 Kafka API 的相关信息。
事件中心虚拟网络连接事件 捕获向事件中心发送流量的 IP 地址和虚拟网络的相关信息。
客户管理的密钥用户日志 捕获与客户管理的密钥相关的操作。
运行时审核日志 在事件中心中捕获了所有数据平面访问操作(例如发送或接收事件)的聚合诊断信息。
应用程序指标日志 捕获与数据平面操作相关的某些指标的聚合信息。

所有日志均以 JavaScript 对象表示法 (JSON) 格式存储。 每个条目均包含字符串字段,这些字段采用以下部分所述的格式。

存档日志架构

存档日志 JSON 字符串包括下表列出的元素:

Name Description 在 Azure 诊断中受支持 在 AZMSArchiveLogs(特定于资源的表)中受支持
TaskName 描述失败的任务 Yes Yes
ActivityId 用于跟踪的内部 ID Yes Yes
trackingId 用于跟踪的内部 ID Yes Yes
resourceId Azure Resource Manager 资源 ID yes Yes
eventHub 事件中心的完整名称(包括命名空间名称) Yes No
EventhubName 事件中心实体的名称 No Yes
partitionId 要写入的事件中心分区 Yes Yes
archiveStep 可能值:ArchiveFlushWriter、DestinationInit Yes Yes
startTime 失败开始时间 Yes No
Time Generated (UTC) 操作时间戳 No Yes
failures 发生失败的次数 Yes Yes
durationInSeconds 失败持续时间 Yes Yes
message Error message Yes Yes
category Log Category Yes No
Provider 发出日志的服务的名称,例如事件中心 No Yes
Type 发出的日志类型 No Yes

以下代码是存档日志 JSON 字符串的示例:

AzureDiagnostics:

{
   "TaskName": "EventHubArchiveUserError",
   "ActivityId": "000000000-0000-0000-0000-0000000000000",
   "trackingId": "0000000-0000-0000-0000-00000000000000000",
   "resourceId": "/SUBSCRIPTIONS/000000000-0000-0000-0000-0000000000000/RESOURCEGROUPS/<Resource Group Name>/PROVIDERS/MICROSOFT.EVENTHUB/NAMESPACES/<Event Hubs Namespace Name>",
   "eventHub": "<Event Hub full name>",
   "partitionId": "1",
   "archiveStep": "ArchiveFlushWriter",
   "startTime": "9/22/2016 5:11:21 AM",
   "failures": 3,
   "durationInSeconds": 360,
   "message": "Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (404) Not Found. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.\r\n   at Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T](HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase`1 cmd, Exception ex)\r\n   at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.<PutBlockImpl>b__3e(RESTCommand`1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx)\r\n   at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult)\r\n   --- End of inner exception stack trace ---\r\n   at Microsoft.WindowsAzure.Storage.Core.Util.StorageAsyncResult`1.End()\r\n   at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass4.<CreateCallbackVoid>b__3(IAsyncResult ar)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.",
   "category": "ArchiveLogs"
}

特定于资源的表条目:

{
   "TaskName": "EventHubArchiveUserError",
   "ActivityId": "000000000-0000-0000-0000-0000000000000",
   "trackingId": "0000000-0000-0000-0000-00000000000000000",
   "resourceId": "/SUBSCRIPTIONS/000000000-0000-0000-0000-0000000000000/RESOURCEGROUPS/<Resource Group Name>/PROVIDERS/MICROSOFT.EVENTHUB/NAMESPACES/<Event Hubs Namespace Name>",
   "EventHubName": "<Event Hub full name>",
   "partitionId": "1",
   "archiveStep": "ArchiveFlushWriter",
   "TimeGenerated(UTC)": "9/22/2016 5:11:21 AM",
   "failures": 3,
   "durationInSeconds": 360,
   "message": "Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (404) Not Found. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.\r\n   at Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T](HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase`1 cmd, Exception ex)\r\n   at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.<PutBlockImpl>b__3e(RESTCommand`1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx)\r\n   at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult)\r\n   --- End of inner exception stack trace ---\r\n   at Microsoft.WindowsAzure.Storage.Core.Util.StorageAsyncResult`1.End()\r\n   at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass4.<CreateCallbackVoid>b__3(IAsyncResult ar)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.",
   "Provider":"EVENTHUB",
   "Type":"AZMSArchiveLogs"
}

操作日志架构

运行日志 JSON 字符串包括下表列出的元素:

Name Description 在 AzureDiagnostics 中受支持 在 AZMSOperationalLogs(特定于资源的表)中受支持
ActivityId 内部 ID,用于跟踪目的 Yes Yes
EventName Operation name. For a list of values for this element, see the Event names Yes Yes
resourceId Azure Resource Manager 资源 ID Yes Yes
SubscriptionId Subscription ID Yes Yes
EventTimeString Operation time Yes No
Time Generated (UTC) 操作时间戳 No Yes
EventProperties 操作的属性。 此元素提供有关事件的详细信息,如下面的示例中所示。 Yes Yes
Status Operation status. The value can be either Succeeded or Failed. Yes Yes
Caller 操作的调用方(Azure 门户或管理客户端) Yes Yes
Category Log Category Yes No
Provider 发出日志的服务的名称,例如事件中心 No Yes
Type 发出的日志类型 No Yes

以下代码是运行日志 JSON 字符串的示例:

AzureDiagnostics:

Example:
{
   "ActivityId": "00000000-0000-0000-0000-00000000000000",
   "EventName": "Create EventHub",
   "resourceId": "/SUBSCRIPTIONS/00000000-0000-0000-0000-0000000000000/RESOURCEGROUPS/<Resource Group Name>/PROVIDERS/MICROSOFT.EVENTHUB/NAMESPACES/<Event Hubs namespace name>",
   "SubscriptionId": "000000000-0000-0000-0000-000000000000",
   "EventTimeString": "9/28/2016 8:40:06 PM +00:00",
   "EventProperties": "{\"SubscriptionId\":\"0000000000-0000-0000-0000-000000000000\",\"Namespace\":\"<Namespace Name>\",\"Via\":\"https://<Namespace Name>.servicebus.windows.net/f8096791adb448579ee83d30e006a13e/?api-version=2016-07\",\"TrackingId\":\"5ee74c9e-72b5-4e98-97c4-08a62e56e221_G1\"}",
   "Status": "Succeeded",
   "Caller": "ServiceBus Client",
   "category": "OperationalLogs"
}

特定于资源的表条目:

Example:
{
   "ActivityId": "00000000-0000-0000-0000-00000000000000",
   "EventName": "Create EventHub",
   "resourceId": "/SUBSCRIPTIONS/00000000-0000-0000-0000-0000000000000/RESOURCEGROUPS/<Resource Group Name>/PROVIDERS/MICROSOFT.EVENTHUB/NAMESPACES/<Event Hubs namespace name>",
   "SubscriptionId": "000000000-0000-0000-0000-000000000000",
   "TimeGenerated (UTC)": "9/28/2016 8:40:06 PM +00:00",
   "EventProperties": "{\"SubscriptionId\":\"0000000000-0000-0000-0000-000000000000\",\"Namespace\":\"<Namespace Name>\",\"Via\":\"https://<Namespace Name>.servicebus.windows.net/f8096791adb448579ee83d30e006a13e/?api-version=2016-07\",\"TrackingId\":\"5ee74c9e-72b5-4e98-97c4-08a62e56e221_G1\"}",
   "Status": "Succeeded",
   "Caller": "ServiceBus Client",
   "Provider": "EVENTHUB",
   "Type":"AZMSOperationalLogs"
}

Event names

事件名称的填充格式是以下枚举中的操作类型 + 资源类型组合。 例如,Create QueueRetrieve Event HubDelete Rule

Operation type Resource type
- Create
- Update
- Delete
- Retrieve
- Unknown
- Namespace
- Queue
- Topic
- Subscription
- 事件中心
- SharedAccessPolicy
- UsageCredit
- Rule
- ConsumerGroup

自动缩放日志架构

自动缩放日志 JSON 包括下表列出的元素:

Name Description 在 Azure 诊断中受支持 在 AZMSAutoscaleLogs(特定于资源的表)中受支持
TrackingId 内部 ID,用于跟踪目的 Yes Yes
ResourceId Azure 资源管理器资源 ID。 Yes Yes
Message 信息性消息,提供有关自动膨胀作的详细信息。 此消息包含给定命名空间的吞吐量单位的以前值和当前值,以及触发了 TU 膨胀的因素。 Yes Yes
Time Generated (UTC) 操作时间戳 No Yes
Provider 发出日志的服务的名称,例如事件中心 No Yes
Type 发出的日志类型 No Yes

下面是一个示例自动缩放事件:

AzureDiagnostics:

{
    "TrackingId": "fb1b3676-bb2d-4b17-85b7-be1c7aa1967e",
    "Message": "Scaled-up EventHub TUs (UpdateStartTimeUTC: 5/13/2021 7:48:36 AM, PreviousValue: 1, UpdatedThroughputUnitValue: 2, AutoScaleReason: 'IncomingMessagesPerSecond reached 2170')",
    "ResourceId": "/subscriptions/0000000-0000-0000-0000-000000000000/resourcegroups/testrg/providers/microsoft.eventhub/namespaces/namespace-name"
}

特定于资源的表条目:

{
    "TrackingId": "fb1b3676-bb2d-4b17-85b7-be1c7aa1967e",
    "Message": "Scaled-up EventHub TUs (UpdateStartTimeUTC: 5/13/2021 7:48:36 AM, PreviousValue: 1, UpdatedThroughputUnitValue: 2, AutoScaleReason: 'IncomingMessagesPerSecond reached 2170')",
    "ResourceId": "/subscriptions/0000000-0000-0000-0000-000000000000/resourcegroups/testrg/providers/microsoft.eventhub/namespaces/namespace-name",
    "timeGenerated (UTC)" : "9/28/2022 8:40:06 PM +00:00",
    "Provider" : "EVENTHUB",
    "Type" : "AZMSAutoscaleLogs"
}

Kafka 协调器日志架构

Kafka 协调器日志 JSON 包括下表列出的元素:

Name Description 在 Azure 诊断中受支持 在 AZMSKafkaCoordinatorLogs(特定于资源的表)中受支持
RequestId 请求 ID,用于跟踪目的 Yes Yes
ResourceId Azure Resource Manager 资源 ID Yes Yes
Operation 在组协调期间执行的作的名称 Yes Yes
ClientId Client ID Yes Yes
NamespaceName Namespace name Yes Yes
SubscriptionId Azure 订阅 ID Yes Yes
Message 信息性或警告消息,提供有关组协调期间执行的操作的详细信息。 Yes Yes
Time Generated (UTC) 操作时间戳 No Yes
Provider 发出日志的服务的名称,例如 ServiceBus No Yes
Type 发出的日志类型 No Yes

Example

AzureDiagnostics:

{
    "RequestId": "FE01001A89E30B020000000304620E2A_KafkaExampleConsumer#0",
    "Operation": "Join.Start",
    "ClientId": "KafkaExampleConsumer#0",
    "Message": "Start join group for new member namespace-name:c:$default:I:KafkaExampleConsumer#0-cc40856f7f3c4607915a571efe994e82, current group size: 0, API version: 2, session timeout: 10000ms, rebalance timeout: 300000ms.",
    "SubscriptionId": "0000000-0000-0000-0000-000000000000",
    "NamespaceName": "namespace-name",
    "ResourceId": "/subscriptions/0000000-0000-0000-0000-000000000000/resourcegroups/testrg/providers/microsoft.eventhub/namespaces/namespace-name",
    "Category": "KafkaCoordinatorLogs"
}

特定于资源的表条目:

{
    "RequestId": "FE01001A89E30B020000000304620E2A_KafkaExampleConsumer#0",
    "Operation": "Join.Start",
    "ClientId": "KafkaExampleConsumer#0",
    "Message": "Start join group for new member namespace-name:c:$default:I:KafkaExampleConsumer#0-cc40856f7f3c4607915a571efe994e82, current group size: 0, API version: 2, session timeout: 10000ms, rebalance timeout: 300000ms.",
    "SubscriptionId": "0000000-0000-0000-0000-000000000000",
    "NamespaceName": "namespace-name",
    "ResourceId": "/subscriptions/0000000-0000-0000-0000-000000000000/resourcegroups/testrg/providers/microsoft.eventhub/namespaces/namespace-name",
    "Time Generated (UTC) ": "9/28/2022 8:40:06 PM +00:00", 
    "Provider" : "EVENTHUB",
    "Type" : "AZMSKafkaCoordinatorLogs"
}

Kafka 用户错误日志架构

Kafka 用户错误日志 JSON 包括下表列出的元素:

Name Description 在 Azure 诊断中受支持 在 AZMSKafkaUserErrorLogs(特定于资源的表)中受支持
TrackingId 跟踪 ID,用于跟踪目的。 Yes Yes
NamespaceName Namespace name Yes Yes
Eventhub 事件中心名称 Yes Yes
PartitionId Partition ID Yes Yes
GroupId Group ID Yes Yes
ClientId Client ID Yes Yes
ResourceId Azure 资源管理器资源 ID。 Yes Yes
Message 信息性消息,提供有关错误的详细信息 Yes Yes
TimeGenerated (UTC) 执行的操作的时间戳 No Yes
Provider 发出日志的服务的名称,例如事件中心 No Yes
Type 发出的日志类型 NO Yes

事件中心虚拟网络连接事件架构

事件中心虚拟网络(虚拟网络)连接事件 JSON 包括下表中列出的元素:

Name Description 在 Azure 诊断中受支持 在 AZMSVNetConnectionevents(特定于资源的表)中受支持
SubscriptionId Azure 订阅 ID Yes Yes
NamespaceName Namespace name Yes Yes
IPAddress 连接到事件中心服务的客户端的 IP 地址 Yes Yes
Action 评估连接请求时事件中心服务执行的操作。 Supported actions are Accept Connection and Deny Connection. Yes Yes
Reason 提供执行操作的原因 Yes No
Message 提供执行操作的原因 No Yes
Count 给定操作的发生次数 Yes Yes
ResourceId Azure 资源管理器资源 ID。 Yes Yes
Time Generated (UTC) 操作时间戳 No Yes
Provider 发出日志的服务的名称,例如 ServiceBus No Yes
Type AZMSVNetConnectionevents No Yes

Virtual network logs are generated only if the namespace allows access from selected networks or from specific IP addresses (IP filter rules). 如果不希望使用这些功能限制对命名空间的访问,仍希望获取虚拟网络日志来跟踪连接到事件中心命名空间的客户端的 IP 地址,则可以使用以下解决方法。 启用 IP 筛选,并添加总可寻址 IPv4 范围(0.0.0.0/1 - 128.0.0.0/1)和 IPv6 范围(::/1 - 8000::/1)。 事件中心 IP 筛选不支持 IPv6 范围。 日志中可能会看到 IPv6 格式的专用终结点地址。

Example

AzureDiagnostics:

{
    "SubscriptionId": "0000000-0000-0000-0000-000000000000",
    "NamespaceName": "namespace-name",
    "IPAddress": "1.2.3.4",
    "Action": "Deny Connection",
    "Reason": "IPAddress doesn't belong to a subnet with Service Endpoint enabled.",
    "Count": "65",
    "ResourceId": "/subscriptions/0000000-0000-0000-0000-000000000000/resourcegroups/testrg/providers/microsoft.eventhub/namespaces/namespace-name",
    "Category": "EventHubVNetConnectionEvent"
}

特定于资源的表条目:

{
    "SubscriptionId": "0000000-0000-0000-0000-000000000000",
    "NamespaceName": "namespace-name",
    "IPAddress": "1.2.3.4",
    "Action": "Deny Connection",
    "Message": "IPAddress doesn't belong to a subnet with Service Endpoint enabled.",
    "Count": "65",
    "ResourceId": "/subscriptions/0000000-0000-0000-0000-000000000000/resourcegroups/testrg/providers/microsoft.eventhub/namespaces/namespace-name",
    "Provider": "EVENTHUB",
    "Time Generated (UTC) ": "9/28/2022 8:40:06 PM +00:00",
    "Type" : "AZMSKafkauserErrorlogs"
     
}

客户管理的密钥用户日志架构

客户管理的密钥用户日志 JSON 包括下表列出的元素:

Name Description 在 Azure 诊断中受支持 在 AZMSCustomerManagedKeyUserLogs(特定于资源的表)中受支持
Category 消息类别的类型。 It's one of the following values: error and info. 例如,如果密钥保管库中的密钥处于禁用状态,则它将是信息类别;如果密钥无法展开,则可能发生错误。 Yes Yes
ResourceId 内部资源 ID,包括 Azure 订阅 ID 和命名空间名称 Yes Yes
KeyVault Key Vault 资源的名称 Yes Yes
Key 用于加密事件中心命名空间的 Key Vault 密钥的名称。 Yes Yes
Version Key Vault 密钥的版本。 Yes Yes
Operation 对密钥保管库中的密钥执行的操作。 例如,禁用/启用密钥、包装或展开。 Yes Yes
Code 与作关联的代码。 示例:错误代码 404 表示找不到密钥。 Yes Yes
Message 消息,提供有关错误或信息性消息的详细信息 Yes Yes
Time Generated (UTC) 操作时间戳 No Yes
Provider 发出日志的服务的名称,例如 ServiceBus No Yes
Type 发出的日志类型 No Yes

下面是客户管理的密钥的日志示例:

AzureDiagnostics:

{
   "TaskName": "CustomerManagedKeyUserLog",
   "ActivityId": "11111111-1111-1111-1111-111111111111",
   "category": "error"
   "resourceId": "/SUBSCRIPTIONS/11111111-1111-1111-1111-11111111111/RESOURCEGROUPS/DEFAULT-EVENTHUB-CENTRALUS/PROVIDERS/MICROSOFT.EVENTHUB/NAMESPACES/FBETTATI-OPERA-EVENTHUB",
   "keyVault": "https://mykeyvault.vault-int.azure-int.net",
   "key": "mykey",
   "version": "1111111111111111111111111111111",
   "operation": "wrapKey",
   "code": "404",
   "message": "Key not found: ehbyok0/111111111111111111111111111111"
}
{
   "TaskName": "CustomerManagedKeyUserLog",
   "ActivityId": "11111111111111-1111-1111-1111111111111",
   "category": "info"
   "resourceId": "/SUBSCRIPTIONS/111111111-1111-1111-1111-11111111111/RESOURCEGROUPS/DEFAULT-EVENTHUB-CENTRALUS/PROVIDERS/MICROSOFT.EVENTHUB/NAMESPACES/FBETTATI-OPERA-EVENTHUB",
   "keyVault": "https://mykeyvault.vault-int.azure-int.net",
   "key": "mykey",
   "version": "111111111111111111111111111111",
   "operation": "disable | restore",
   "code": "",
   "message": ""
}

特定于资源的表条目:

{
   "TaskName": "CustomerManagedKeyUserLog",
   "ActivityId": "11111111-1111-1111-1111-111111111111",
   "category": "error"
   "resourceId": "/SUBSCRIPTIONS/11111111-1111-1111-1111-11111111111/RESOURCEGROUPS/DEFAULT-EVENTHUB-CENTRALUS/PROVIDERS/MICROSOFT.EVENTHUB/NAMESPACES/FBETTATI-OPERA-EVENTHUB",
   "keyVault": "https://mykeyvault.vault-int.azure-int.net",
   "key": "mykey",
   "version": "1111111111111111111111111111111",
   "operation": "wrapKey",
   "code": "404",
   "message": "Key not found: ehbyok0/111111111111111111111111111111",
   "Provider": "EVENTHUB",
   "Time Generated (UTC) ": "9/28/2022 8:40:06 PM +00:00",
   "Type" : "AZMSCustomerManagedKeyUserLogs"
}
{
   "TaskName": "CustomerManagedKeyUserLog",
   "ActivityId": "11111111111111-1111-1111-1111111111111",
   "category": "info"
   "resourceId": "/SUBSCRIPTIONS/111111111-1111-1111-1111-11111111111/RESOURCEGROUPS/DEFAULT-EVENTHUB-CENTRALUS/PROVIDERS/MICROSOFT.EVENTHUB/NAMESPACES/FBETTATI-OPERA-EVENTHUB",
   "keyVault": "https://mykeyvault.vault-int.azure-int.net",
   "key": "mykey",
   "version": "111111111111111111111111111111",
   "operation": "disable | restore",
   "code": "",
   "message": "",
   "Provider": "EVENTHUB",
   "Time Generated (UTC) ": "9/28/2022 8:40:06 PM +00:00",
   "Type" : "AZMSCustomerManagedKeyUserLogs"
  
}

下面是启用 BYOK 加密时要查找的常见错误代码。

Action Error code 数据的生成状态
从密钥保管库中删除包装/展开权限 403 Inaccessible
从授予包装/解包权限的 Microsoft Entra 主体中删除Microsoft Entra ID 角色成员身份 403 Inaccessible
从密钥保管库中删除加密密钥 404 Inaccessible
删除密钥保管库 404 无法访问(假设启用软删除,这是必需的设置。)
更改加密密钥的过期期限,使其已过期 403 Inaccessible
更改 NBF(不早于),使密钥加密密钥不会处于活动状态 403 Inaccessible
为密钥保管库防火墙选择“允许 MSFT 服务”选项,或阻止对具有加密密钥的密钥保管库进行网络访问 403 Inaccessible
将密钥保管库移到其他租户 404 Inaccessible
间歇性网络问题或 DNS/AAD/MSI 中断 可使用缓存数据加密密钥进行访问

运行时审核日志

运行时审核日志在事件中心中捕获所有数据平面访问操作(例如发送或接收事件)的聚合诊断信息。

Note

Runtime audit logs are available only in premium and dedicated tiers.

运行时审计日志包括下表中列出的元素:

Name Description 在 Azure 诊断中受支持 在特定于资源的表中受支持
ActivityId 随机生成的 UUID,确保审核活动的唯一性。 Yes Yes
ActivityName 运行时操作名称。 Yes Yes
ResourceId 与活动关联的资源。 Yes Yes
Timestamp Aggregation time. Yes No
TimeGenerated [UTC] 执行操作的时间 (UTC) No Yes
Status 活动的状态(成功或失败)。 Yes Yes
Protocol 与操作关联的协议类型。 Yes Yes
AuthType 身份验证类型(Microsoft Entra ID 或 SAS 策略)。 Yes Yes
AuthKey 用于对资源进行身份验证的 Microsoft Entra ID 应用程序 ID 或 SAS 策略名称。 Yes Yes
NetworkType 网络访问类型:PublicPrivate Yes Yes
ClientIP 客户端应用程序的 IP 地址。 Yes Yes
Count 在 1 分钟的聚合时间段内执行的操作总数。 Yes Yes
Properties 特定于数据平面操作的元数据。 Yes Yes
Category Log category Yes No
Provider 发出日志的服务名称,例如 EventHubs No Yes
Type 发出的日志类型 No Yes

以下是运行时审核日志条目的示例:

AzureDiagnostics:

{
    "ActivityId": "<activity id>",
    "ActivityName": "ConnectionOpen | Authorization | SendMessage | ReceiveMessage",
    "ResourceId": "/SUBSCRIPTIONS/xxx/RESOURCEGROUPS/<Resource Group Name>/PROVIDERS/MICROSOFT.EVENTHUB/NAMESPACES/<Event Hubs namespace>/eventhubs/<event hub name>",
    "Time": "1/1/2021 8:40:06 PM +00:00",
    "Status": "Success | Failure",
    "Protocol": "AMQP | KAFKA | HTTP | Web Sockets", 
    "AuthType": "SAS | Azure Active Directory", 
    "AuthId": "<AAD application name | SAS policy name>",
    "NetworkType": "Public | Private", 
    "ClientIp": "x.x.x.x",
    "Count": 1,
    "Category": "RuntimeAuditLogs"
 }

特定于资源的表条目:

{
    "ActivityId": "<activity id>",
    "ActivityName": "ConnectionOpen | Authorization | SendMessage | ReceiveMessage",
    "ResourceId": "/SUBSCRIPTIONS/xxx/RESOURCEGROUPS/<Resource Group Name>/PROVIDERS/MICROSOFT.EVENTHUB/NAMESPACES/<Event Hubs namespace>/eventhubs/<event hub name>",
    "TimeGenerated (UTC)": "1/1/2021 8:40:06 PM +00:00",
    "Status": "Success | Failure",
    "Protocol": "AMQP | KAFKA | HTTP | Web Sockets", 
    "AuthType": "SAS | Azure Active Directory", 
    "AuthId": "<AAD application name | SAS policy name>",
    "NetworkType": "Public | Private", 
    "ClientIp": "x.x.x.x",
    "Count": 1,
    "Type": "AZMSRuntimeAUditLogs",
    "Provider":"EVENTHUB"
 }

应用程序指标日志

应用程序指标日志捕获与数据平面操作相关的某些指标的聚合信息。 捕获的信息包括以下运行时指标。

Note

Application metrics logs are available only in premium and dedicated tiers.

Name Description
ConsumerLag 表示使用者和生产者之间的延迟。 For more details, see Consumer lag section.
NamespaceActiveConnections 客户端与事件中心之间建立的活动连接的详细信息。
GetRuntimeInfo 从事件中心获取运行时信息。
GetPartitionRuntimeInfo 获取事件中心的逻辑分区的大致运行时信息。
IncomingMessages 使用 AMQP 协议发布到事件中心的消息数的详细信息。
IncomingBytes 发送到事件中心的发布服务器吞吐量的详细信息
OutgoingMessages 使用 AMQP 协议从事件中心使用的消息数的详细信息。
OutgoingBytes 事件中心的使用者吞吐量的详细信息。
OffsetCommit 对事件中心进行的偏移提交调用数量
OffsetFetch 对事件中心进行的偏移提取调用数量。

Consumer lag

  • 以下几点控制 Kafka 消费者消费滞后的排放。
    • 如果命名空间下的任何 Kafka 使用者组没有偏移提交,则命名空间在 Kafka 偏移量提交点处于空闲状态。

    • 如果命名空间空闲一小时,则延迟指标的排放将停止。

    • 只要命名空间没有空闲进行偏移提交,该命名空间下的所有 Kafka 使用者组都会发出指标。

      • 如果命名空间处于非空闲状态,并且使用者组的最后一个偏移量提交早于中心或主题的保留期,将不再发出使用者滞后时间。
  • 对于 AMQP 使用者,仅当使用者组上有活动接收器时,才会发出使用者滞后时间。

诊断错误日志

诊断错误日志会记录任何客户端、限制和配额超出错误的错误消息。 诊断错误日志为识别出的错误提供详细的诊断。

诊断错误日志包括下表中列出的元素:

Name Description 在 Azure 诊断中受支持 在 AZMSDiagnosticErrorLogs(特定于资源的表)中受支持
ActivityId 随机生成的 UUID,确保审核活动的唯一性。 Yes Yes
ActivityName Operation name Yes Yes
NamespaceName 命名空间名称 Yes yes
EntityType 实体类型 Yes Yes
EntityName 实体名称 Yes Yes
OperationResult 操作中的错误类型(clienterrorserverbusyquotaexceeded Yes Yes
ErrorCount 1 分钟聚合时间内相同错误的计数。 Yes Yes
ErrorMessage 详细错误消息 Yes Yes
ResourceProvider 发出日志的服务的名称。 可能的值:Microsoft.EventHubMicrosoft.ServiceBus Yes Yes
Time Generated (UTC) Operation time No Yes
EventTimestamp Operation Time Yes No
Category Log category Yes No
Type 发出的日志类型 No Yes

下面是诊断错误日志条目的示例:

{
    "ActivityId": "0000000000-0000-0000-0000-00000000000000",
    "SubscriptionId": "<Azure Subscription Id",
    "NamespaceName": "Name of Event Hubs Namespace",
    "EntityType": "EventHub",
    "EntityName": "Name of Event Hub",
    "ActivityName": "SendMessage",
    "ResourceId": "/SUBSCRIPTIONS/xxx/RESOURCEGROUPS/<Resource Group Name>/PROVIDERS/MICROSOFT.EVENTHUB/NAMESPACES/<Event hub namespace name>",,
    "OperationResult": "ServerBusy",
    "ErrorCount": 1,
    "EventTimestamp": "3/27/2024 1:02:29.126 PM +00:00",
    "ErrorMessage": "the request was terminated because the entity is being throttled by the application group with application group name <application group name> and policy name <throttling policy name>.error code: 50013.",
    "category": "DiagnosticErrorLogs"
 }

特定于资源的表条目:

{
    "ActivityId": "0000000000-0000-0000-0000-00000000000000",
    "NamespaceName": "Name of Event Hubs Namespace",
    "EntityType": "Event Hub",
    "EntityName": "Name of Event Hub",
    "ActivityName": "SendMessage",
    "ResourceId": "/SUBSCRIPTIONS/xxx/RESOURCEGROUPS/<Resource Group Name>/PROVIDERS/MICROSOFT.EVENTHUB/NAMESPACES/<Event hub namespace name>",,
    "OperationResult": "ServerBusy",
    "ErrorCount": 1,
    "TimeGenerated [UTC]": "1/27/2024 4:02:29.126 PM +00:00",
    "ErrorMessage": "The request was terminated because the entity is being throttled by the application group with application group name <application group name> and policy name <throttling policy name>.error code: 50013.",
    "Type": "AZMSDiagnosticErrorLogs"
 }

Activity log

链接表列出了可在此服务的活动日志中记录的操作。 这些操作是活动日志中所有可能的资源提供程序操作的子集。

有关活动日志条目架构的详细信息,请参阅活动日志架构