监视 Azure IoT 中心数据参考Monitoring Azure IoT Hub data reference

请参阅监视 Azure IoT 中心,详细了解如何收集和分析 Azure IoT 中心的监视数据。See Monitor Azure IoT Hub for details on collecting and analyzing monitoring data for Azure IoT Hub.

指标Metrics

本节列出了 Azure IoT 中心自动收集的所有平台指标。This section lists all the automatically collected platform metrics for Azure IoT Hub. IoT 中心指标的资源提供程序命名空间为 Microsoft.Devices,类型命名空间为 IoTHubs 。The resource provider namespace for IoT Hub metrics is Microsoft.Devices and the type Namespace is IoTHubs.

以下小节按常规类别细分了 IoT 中心平台指标,并按它们在 Azure 门户中显示的名称列出它们。The following subsections break out the IoT Hub platform metrics by general category and list them by the display name that they appear in the Azure portal with. 还提供了与每个小节中显示的指标相关的信息。Information is also provided relevant to the metrics that appear in each subsection.

你还可以在 Azure Monitor 文档中的 Microsoft.Devices/IotHubs 下找到一个按指标名称列出所有 IoT 中心平台指标的表。You can also find a single table that lists all of the IoT Hub platform metrics by metric name under Microsoft.Devices/IotHubs in the Azure Monitor documentation. 请注意,此表并不提供本文中涵盖的一些信息,如一些指标支持的聚合Be aware that this table does not provide some of the information, like supported aggregations for some metrics, available in this article.

若要了解其他 Azure 服务支持的指标,请参阅 Azure Monitor 支持的指标To learn about metrics supported by other Azure services, see Supported metrics with Azure Monitor.

本节主题Topics in this section

支持的聚合Supported aggregations

每个表中的“聚合类型”列对应于为图表或警报选择指标时使用的默认聚合。The Aggregation Type column in each table corresponds to the default aggregation that is used when the metric is selected for a chart or alert.

显示指标聚合的屏幕截图

对于大多数指标,所有聚合类型都是有效的;但是,对于计数指标,即“计价单位”列值为“计数”的指标,只有一些聚合是有效的 。For most metrics, all aggregation types are valid; however, for count metrics, those with a Unit column value of Count, only some aggregations are valid. 计数指标可以是以下两种类型之一:Count metrics can be one of two types:

  • 对于单点计数指标,IoT 中心每次执行测量操作时都会注册一个数据点(实质上为 1)。For Single-point count metrics, IoT Hub registers a single data point -- essentially a 1 -- every time the measured operation occurs. 然后 Azure Monitor 在指定的粒度上对这些数据点进行求和。Azure Monitor then sums these data points over the specified granularity. 单点指标的示例有发送的遥测消息数和已完成的 C2D 消息传递次数 。Examples of Single-point metrics are Telemetry messages sent and C2D message deliveries completed. 对于这些指标,唯一相关的聚合类型为总计(总和)。For these metrics, the only relevant aggregation type is Total (Sum). 通过门户可选择最小值、最大值和平均值;然而,这些值始终为 1。The portal allows you to choose minimum, maximum, and average; however, these values will always be 1.

  • 对于快照计数指标,当进行测量操作时,IoT 中心将登记总计数。For Snapshot count metrics, IoT Hub registers a total count when the measured operation occurs. 当前,IoT 中心发布了三种快照指标:已使用的消息总数、设备总数(预览)和已连接设备数(预览) 。Currently, there are three Snapshot metrics emitted by IoT Hub: Total number of messages used, Total devices (preview), and Connected devices (preview). 因为这些指标在每次发出时都显示一个“总数”,所以在指定的粒度上对它们进行求和没有任何意义。Because these metrics present a "total" quantity every time they are emitted, summing them over the specified granularity makes no sense. Azure Monitor 仅限为这些指标的聚合类型选择平均值、最小值和最大值。Azure Monitor limits you to selecting average, minimum, and maximum for the aggregation type for these metrics.

云到设备命令指标Cloud to device command metrics

指标显示名称Metric Display Name 指标Metric 计价单位Unit 聚合类型Aggregation Type 说明Description 维度Dimensions
过期的 C2D 消息数(预览版)C2D Messages Expired (preview) C2DMessagesExpiredC2DMessagesExpired 计数Count 总计Total 过期的云到设备消息数Number of expired cloud-to-device messages None
已完成的 C2D 消息传递次数C2D message deliveries completed c2d.commands.egress.complete.successc2d.commands.egress.complete.success 计数Count 总计Total 设备成功完成的云到设备消息传递次数Number of cloud-to-device message deliveries completed successfully by the device None
丢弃的 C2D 消息数C2D messages abandoned c2d.commands.egress.abandon.successc2d.commands.egress.abandon.success 计数Count 总计Total 设备丢弃的云到设备消息数Number of cloud-to-device messages abandoned by the device None
拒绝的 C2D 消息数C2D messages rejected c2d.commands.egress.reject.successc2d.commands.egress.reject.success 计数Count 总计Total 设备拒绝的云到设备消息数Number of cloud-to-device messages rejected by the device None

对于“计价单位”值为“计数”的指标,只有总计(总和)聚合有效 。For metrics with a Unit value of Count, only total (sum) aggregation is valid. 最小值、最大值和平均值聚合始终返回 1。Minimum, maximum, and average aggregations always return 1. 有关详细信息,请参阅支持的聚合For more information, see Supported aggregations.

云到设备直接方法指标Cloud to device direct methods metrics

指标显示名称Metric Display Name 指标Metric 计价单位Unit 聚合类型Aggregation Type 说明Description 维度Dimensions
失败的直接方法调用数Failed direct method invocations c2d.methods.failurec2d.methods.failure 计数Count 总计Total 所有失败直接方法调用的计数。The count of all failed direct method calls. None
直接方法调用的请求大小Request size of direct method invocations c2d.methods.requestSizec2d.methods.requestSize 字节Bytes 平均值Average 所有成功的直接方法请求计数。The count of all successful direct method requests. None
直接方法调用的响应大小Response size of direct method invocations c2d.methods.responseSizec2d.methods.responseSize 字节Bytes 平均值Average 所有成功的直接方法响应计数。The count of all successful direct method responses. None
成功的直接方法调用数Successful direct method invocations c2d.methods.successc2d.methods.success 计数Count 总计Total 所有成功的直接方法调用的计数。The count of all successful direct method calls. None

对于“计价单位”值为“计数”的指标,只有总计(总和)聚合有效 。For metrics with a Unit value of Count only total (sum) aggregation is valid. 最小值、最大值和平均值聚合始终返回 1。Minimum, maximum, and average aggregations always return 1. 有关详细信息,请参阅支持的聚合For more information, see Supported aggregations.

云到设备孪生操作指标Cloud to device twin operations metrics

指标显示名称Metric Display Name 指标Metric 计价单位Unit 聚合类型Aggregation Type 说明Description 维度Dimensions
后端的失败孪生读取数Failed twin reads from back end c2d.twin.read.failurec2d.twin.read.failure 计数Count 总计Total 由后端发起的所有失败孪生读取的计数。The count of all failed back-end-initiated twin reads. None
后端的失败孪生更新数Failed twin updates from back end c2d.twin.update.failurec2d.twin.update.failure 计数Count 总计Total 由后端发起的所有失败孪生更新的计数。The count of all failed back-end-initiated twin updates. None
后端的孪生读取的响应大小Response size of twin reads from back end c2d.twin.read.sizec2d.twin.read.size 字节Bytes 平均值Average 由后端发起的所有成功孪生读取的计数。The count of all successful back-end-initiated twin reads. None
后端的失败孪生更新大小Size of twin updates from back end c2d.twin.update.sizec2d.twin.update.size 字节Bytes 平均值Average 由后端发起的所有成功孪生更新的总大小。The total size of all successful back-end-initiated twin updates. None
后端的成功孪生读取数Successful twin reads from back end c2d.twin.read.successc2d.twin.read.success 计数Count 总计Total 由后端发起的所有成功孪生读取的计数。The count of all successful back-end-initiated twin reads. None
后端的成功孪生更新数Successful twin updates from back end c2d.twin.update.successc2d.twin.update.success 计数Count 总计Total 由后端发起的所有成功孪生更新的计数。The count of all successful back-end-initiated twin updates. None

对于“计价单位”值为“计数”的指标,只有总计(总和)聚合有效 。For metrics with a Unit value of Count, only total (sum) aggregation is valid. 最小值、最大值和平均值聚合始终返回 1。Minimum, maximum, and average aggregations always return 1. 有关详细信息,请参阅支持的聚合For more information, see Supported aggregations.

配置指标Configurations metrics

指标显示名称Metric Display Name 指标Metric 计价单位Unit 聚合类型Aggregation Type 说明Description 维度Dimensions
配置指标Configuration Metrics 配置configurations 计数Count 总计Total 在一组目标设备上为设备配置和 IoT Edge 部署执行的 CRUD 操作总数。Number of total CRUD operations performed for device configuration and IoT Edge deployment, on a set of target devices. 这还包括由于这些配置而修改设备孪生或模块孪生的操作的数量。This also includes the number of operations that modify the device twin or module twin because of these configurations. None

对于“计价单位”值为“计数”的指标,只有总计(总和)聚合有效 。For metrics with a Unit value of Count, only total (sum) aggregation is valid. 最小值、最大值和平均值聚合始终返回 1。Minimum, maximum, and average aggregations always return 1. 有关详细信息,请参阅支持的聚合For more information, see Supported aggregations.

每日配额指标Daily quota metrics

指标显示名称Metric Display Name 指标Metric 计价单位Unit 聚合类型Aggregation Type 说明Description 维度Dimensions
设备数据用量总计Total device data usage deviceDataUsagedeviceDataUsage 字节Bytes 总计Total 从与 IotHub 相连的任意设备传出的字节,以及传入到与 IotHub 相连的任意设备的字节Bytes transferred to and from any devices connected to IotHub None
设备数据用量总计(预览)Total device data usage (preview) deviceDataUsageV2deviceDataUsageV2 字节Bytes 总计Total 从与 IotHub 相连的任意设备传出的字节,以及传入到与 IotHub 相连的任意设备的字节Bytes transferred to and from any devices connected to IotHub None
已使用的消息总数Total number of messages used dailyMessageQuotaUseddailyMessageQuotaUsed 计数Count 平均值Average 今天使用的消息总数。Number of total messages used today. 这是累积值,每日 00:00 UTC 重置为零。This is a cumulative value that is reset to zero at 00:00 UTC every day. None

对于“已使用的消息总数”,只支持最小值、最大值和平均值聚合。For Total number of messages used, only minimum, maximum, and average aggregations are supported. 有关详细信息,请参阅支持的聚合For more information, see Supported aggregations.

设备指标Device metrics

指标显示名称Metric Display Name 指标Metric 计价单位Unit 聚合类型Aggregation Type 说明Description 维度Dimensions
设备总数(已弃用)Total devices (deprecated) devices.totalDevicesdevices.totalDevices 计数Count 总计Total 已注册到 IoT 中心的设备数目Number of devices registered to your IoT hub None
连接的设备数(已弃用)Connected devices (deprecated) devices.connectedDevices.allProtocoldevices.connectedDevices.allProtocol 计数Count 总计Total 已连接到 IoT 中心的设备数目Number of devices connected to your IoT hub None
设备总数(预览)Total devices (preview) totalDeviceCounttotalDeviceCount 计数Count 平均值Average 已注册到 IoT 中心的设备数目Number of devices registered to your IoT hub None
连接设备数(预览)Connected devices (preview) connectedDeviceCountconnectedDeviceCount 计数Count 平均值Average 已连接到 IoT 中心的设备数目Number of devices connected to your IoT hub None

对于设备总数(已弃用)和连接的设备数(已弃用),只有总计(总和)聚合有效 。For Total devices (deprecated) and Connected devices (deprecated), only total (sum) aggregation is valid. 最小值、最大值和平均值聚合始终返回 1。Minimum, maximum, and average aggregations always return 1. 有关详细信息,请参阅支持的聚合For more information, see Supported aggregations.

对于设备总数(预览)和已连接设备数(预览),只有最小值、最大值和平均值聚合有效 。For Total devices (preview) and Connected devices (preview), only minimum, maximum, and average aggregations are valid. 有关详细信息,请参阅支持的聚合For more information, see Supported aggregations.

已连接设备数(预览)和设备总数(预览)不能通过诊断设置导出 。Connected devices (preview) and Total devices (preview) are not exportable via diagnostic settings.

设备遥测指标Device telemetry metrics

指标显示名称Metric Display Name 指标Metric 计价单位Unit 聚合类型Aggregation Type 说明Description 维度Dimensions
限制错误数Number of throttling errors d2c.telemetry.ingress.sendThrottled2c.telemetry.ingress.sendThrottle 计数Count 总计Total 由于设备吞吐量限制而导致的限制错误数Number of throttling errors due to device throughput throttles None
遥测消息发送尝试次数Telemetry message send attempts d2c.telemetry.ingress.allProtocold2c.telemetry.ingress.allProtocol 计数Count 总计Total 尝试发送到 IoT 中心的、设备到云的遥测消息数Number of device-to-cloud telemetry messages attempted to be sent to your IoT hub None
发送的遥测消息数Telemetry messages sent d2c.telemetry.ingress.successd2c.telemetry.ingress.success 计数Count 总计Total 成功发送到 IoT 中心的、设备到云的遥测消息数Number of device-to-cloud telemetry messages sent successfully to your IoT hub None

对于“计价单位”值为“计数”的指标,只有总计(总和)聚合有效 。For metrics with a Unit value of Count, only total (sum) aggregation is valid. 最小值、最大值和平均值聚合始终返回 1。Minimum, maximum, and average aggregations always return 1. 有关详细信息,请参阅支持的聚合For more information, see Supported aggregations.

设备到云孪生操作指标Device to cloud twin operations metrics

指标显示名称Metric Display Name 指标Metric 计价单位Unit 聚合类型Aggregation Type 说明Description 维度Dimensions
设备的失败孪生读取数Failed twin reads from devices d2c.twin.read.failured2c.twin.read.failure 计数Count 总计Total 由设备发起的所有失败孪生读取的计数。The count of all failed device-initiated twin reads. None
设备的失败孪生更新数Failed twin updates from devices d2c.twin.update.failured2c.twin.update.failure 计数Count 总计Total 由设备发起的所有失败的孪生更新的计数。The count of all failed device-initiated twin updates. None
设备的孪生读取的响应大小Response size of twin reads from devices d2c.twin.read.sized2c.twin.read.size 字节Bytes 平均值Average 由设备发起的所有成功的孪生读取的数量。The number of all successful device-initiated twin reads. None
设备的孪生更新的大小Size of twin updates from devices d2c.twin.update.sized2c.twin.update.size 字节Bytes 平均值Average 由设备发起的所有成功的孪生更新的总大小。The total size of all successful device-initiated twin updates. None
设备的成功孪生读取数Successful twin reads from devices d2c.twin.read.successd2c.twin.read.success 计数Count 总计Total 由设备发起的所有成功孪生读取的计数。The count of all successful device-initiated twin reads. None
设备的成功孪生更新数Successful twin updates from devices d2c.twin.update.successd2c.twin.update.success 计数Count 总计Total 由设备发起的所有成功的孪生更新的计数。The count of all successful device-initiated twin updates. None

对于“计价单位”值为“计数”的指标,只有总计(总和)聚合有效 。For metrics with a Unit value of Count, only total (sum) aggregation is valid. 最小值、最大值和平均值聚合始终返回 1。Minimum, maximum, and average aggregations always return 1. 有关详细信息,请参阅支持的聚合For more information, see Supported aggregations.

事件网格指标Event grid metrics

指标显示名称Metric Display Name 指标Metric 计价单位Unit 聚合类型Aggregation Type 说明Description 维度Dimensions
事件网格传送(预览版)Event Grid deliveries (preview) EventGridDeliveriesEventGridDeliveries 计数Count 总计Total 发布到事件网格的 IoT 中心事件的数量。The number of IoT Hub events published to Event Grid. 使用 Result 维度表示成功和失败请求的数量。Use the Result dimension for the number of successful and failed requests. EventType 维度显示事件的类型 (https://aka.ms/ioteventgrid) 。EventType dimension shows the type of event (https://aka.ms/ioteventgrid). Result、Result,
EventTypeEventType
有关详细信息,请参阅指标维度For more information, see Metric dimensions.
事件网格延迟(预览)Event Grid latency (preview) EventGridLatencyEventGridLatency 毫秒Milliseconds 平均值Average 从生成 IoT 中心事件到将事件发布到事件网格的平均延迟(毫秒)。The average latency (milliseconds) from when the Iot Hub event was generated to when the event was published to Event Grid. 此数值是所有事件类型的平均。This number is an average between all event types. 若要查看特定事件类型的延迟,请使用 EventType 维度。Use the EventType dimension to see latency of a specific type of event. EventTypeEventType
有关详细信息,请参阅指标维度For more information, see Metric dimensions.

对于“计价单位”值为“计数”的指标,只有总计(总和)聚合有效 。For metrics with a Unit value of Count, only total (sum) aggregation is valid. 最小值、最大值和平均值聚合始终返回 1。Minimum, maximum, and average aggregations always return 1. 有关详细信息,请参阅支持的聚合For more information, see Supported aggregations.

作业指标Jobs metrics

指标显示名称Metric Display Name 指标Metric 计价单位Unit 聚合类型Aggregation Type 说明Description 维度Dimensions
已完成的作业Completed jobs jobs.completedjobs.completed 计数Count 总计Total 所有已完成的作业的计数。The count of all completed jobs. None
对列出作业的失败调用数Failed calls to list jobs jobs.listJobs.failurejobs.listJobs.failure 计数Count 总计Total 对列出作业的所有失败调用的计数。The count of all failed calls to list jobs. None
方法调用作业的创建失败数Failed creations of method invocation jobs jobs.createDirectMethodJob.failurejobs.createDirectMethodJob.failure 计数Count 总计Total 直接方法调用作业创建失败的所有次数。The count of all failed creation of direct method invocation jobs. None
孪生更新作业创建失败数Failed creations of twin update jobs jobs.createTwinUpdateJob.failurejobs.createTwinUpdateJob.failure 计数Count 总计Total 孪生更新作业创建失败的所有次数。The count of all failed creation of twin update jobs. None
失败的作业取消数Failed job cancellations jobs.cancelJob.failurejobs.cancelJob.failure 计数Count 总计Total 用来取消作业的调用失败的次数。The count of all failed calls to cancel a job. None
失败的作业查询数Failed job queries jobs.queryJobs.failurejobs.queryJobs.failure 计数Count 总计Total 对查询作业的所有失败调用的计数。The count of all failed calls to query jobs. None
失败的作业数Failed jobs jobs.failedjobs.failed 计数Count 总计Total 所有失败的作业的计数。The count of all failed jobs. None
对列出作业的成功调用数Successful calls to list jobs jobs.listJobs.successjobs.listJobs.success 计数Count 总计Total 对列出作业的所有成功调用的计数。The count of all successful calls to list jobs. None
方法调用作业的创建成功数Successful creations of method invocation jobs jobs.createDirectMethodJob.successjobs.createDirectMethodJob.success 计数Count 总计Total 直接方法调用作业创建成功的所有次数。The count of all successful creation of direct method invocation jobs. None
孪生更新作业创建成功数Successful creations of twin update jobs jobs.createTwinUpdateJob.jobs.createTwinUpdateJob.
successsuccess
计数Count 总计Total 孪生更新作业创建成功的所有次数。The count of all successful creation of twin update jobs. None
成功的作业取消数Successful job cancellations jobs.cancelJob.successjobs.cancelJob.success 计数Count 总计Total 用来取消作业的调用成功的次数。The count of all successful calls to cancel a job. None
成功的作业查询数Successful job queries jobs.queryJobs.successjobs.queryJobs.success 计数Count 总计Total 对查询作业的所有成功调用的计数。The count of all successful calls to query jobs. None

对于“计价单位”值为“计数”的指标,只有总计(总和)聚合有效 。For metrics with a Unit value of Count, only total (sum) aggregation is valid. 最小值、最大值和平均值聚合始终返回 1。Minimum, maximum, and average aggregations always return 1. 有关详细信息,请参阅支持的聚合For more information, see Supported aggregations.

路由指标Routing metrics

指标显示名称Metric Display Name 指标Metric 计价单位Unit 聚合类型Aggregation Type 说明Description 维度Dimensions
路由传递尝试次数(预览版)Routing Delivery Attempts (preview) RoutingDeliveriesRoutingDeliveries 计数Count 总计Total 这是路由传递指标。This is the routing delivery metric. 使用维度标识特定终结点或特定路由源的传递状态。Use the dimensions to identify the delivery status for a specific endpoint or for a specific routing source. Result、Result,
RoutingSource、RoutingSource,
EndpointType、EndpointType,
FailureReasonCategory、FailureReasonCategory,
EndpointNameEndpointName
有关详细信息,请参阅指标维度For more information, see Metric dimensions.
路由传递数据大小(以字节为单位)(预览版)Routing Delivery Data Size In Bytes (preview) RoutingDataSizeInBytesDeliveredRoutingDataSizeInBytesDelivered 字节Bytes 总计Total IoT 中心路由到自定义终结点和内置终结点的总字节数。The total number of bytes routed by IoT Hub to custom endpoint and built-in endpoint. 使用维度标识路由到特定终结点或特定路由源的数据大小。Use the dimensions to identify data size routed to a specific endpoint or for a specific routing source. RoutingSource、RoutingSource,
EndpointTypeEndpointType
EndpointNameEndpointName
有关详细信息,请参阅指标维度For more information, see Metric dimensions.
路由延迟(预览版)Routing Latency (preview) RoutingDeliveryLatencyRoutingDeliveryLatency 毫秒Milliseconds 平均值Average 这是路由传递延迟指标。This is the routing delivery latency metric. 使用维度标识特定终结点或特定路由源的延迟。Use the dimensions to identify the latency for a specific endpoint or for a specific routing source. RoutingSource、RoutingSource,
EndpointType、EndpointType,
EndpointNameEndpointName
有关详细信息,请参阅指标维度For more information, see Metric dimensions.
路由:将 Blob 传送到存储的次数Routing: blobs delivered to storage d2c.endpoints.egress.storage.blobsd2c.endpoints.egress.storage.blobs 计数Count 总计Total IoT 中心路由将 Blob 传送到存储终结点的次数。The number of times IoT Hub routing delivered blobs to storage endpoints. None
路由:传送到存储的数据量Routing: data delivered to storage d2c.endpoints.egress.storage.bytesd2c.endpoints.egress.storage.bytes 字节Bytes 总计Total IoT 中心路由传送到存储终结点的数据量(字节)。The amount of data (bytes) IoT Hub routing delivered to storage endpoints. None
路由:事件中心的消息延迟Routing: message latency for Event Hub d2c.endpoints.latency.eventHubsd2c.endpoints.latency.eventHubs 毫秒Milliseconds 平均值Average 消息进入 IoT 中心与进入事中心类型的自定义终结点之间的平均延迟(毫秒)。The average latency (milliseconds) between message ingress to IoT Hub and message ingress into custom endpoints of type Event Hub. 这不包括指向内置终结点(事件)的消息路由。This does not include messages routes to built-in endpoint (events). None
路由:服务总线队列的消息延迟Routing: message latency for Service Bus Queue d2c.endpoints.latency.serviceBusQueuesd2c.endpoints.latency.serviceBusQueues 毫秒Milliseconds 平均值Average 消息进入 IoT 中心与消息进入服务总线队列终结点之间的平均延迟(毫秒)。The average latency (milliseconds) between message ingress to IoT Hub and message ingress into a Service Bus queue endpoint. None
路由:服务总线主题的消息延迟Routing: message latency for Service Bus Topic d2c.endpoints.latency.serviceBusTopicsd2c.endpoints.latency.serviceBusTopics 毫秒Milliseconds 平均值Average 消息进入 IoT 中心与消息进入服务总线主题终结点之间的平均延迟(毫秒)。The average latency (milliseconds) between message ingress to IoT Hub and message ingress into a Service Bus topic endpoint. None
路由:消息/事件的消息延迟Routing: message latency for messages/events d2c.endpoints.latency.builtIn.eventsd2c.endpoints.latency.builtIn.events 毫秒Milliseconds 平均值Average 消息进入 IoT 中心与遥测消息进入内置终结点(消息/事件)以及回退路由之间的平均延迟(毫秒)。The average latency (milliseconds) between message ingress to IoT Hub and message ingress into the built-in endpoint (messages/events) and fallback route. None
路由:存储的消息延迟Routing: message latency for storage d2c.endpoints.latency.storaged2c.endpoints.latency.storage 毫秒Milliseconds 平均值Average 消息进入 IoT 中心与消息进入存储终结点之间的平均延迟(毫秒)。The average latency (milliseconds) between message ingress to IoT Hub and message ingress into a storage endpoint. None
路由:消息传送到事件中心的次数Routing: messages delivered to Event Hub d2c.endpoints.egress.eventHubsd2c.endpoints.egress.eventHubs 计数Count 总计Total IoT 中心路由成功将消息传送到事件中心类型的自定义终结点的次数。The number of times IoT Hub routing successfully delivered messages to custom endpoints of type Event Hub. 这不包括指向内置终结点(事件)的消息路由。This does not include messages routes to built-in endpoint (events). None
路由:消息传送到服务总线队列的次数Routing: messages delivered to Service Bus Queue d2c.endpoints.egress.serviceBusQueuesd2c.endpoints.egress.serviceBusQueues 计数Count 总计Total IoT 中心路由成功将消息传送到服务总线队列终结点的次数。The number of times IoT Hub routing successfully delivered messages to Service Bus queue endpoints. None
路由:消息传送到服务总线主题的次数Routing: messages delivered to Service Bus Topic d2c.endpoints.egress.serviceBusTopicsd2c.endpoints.egress.serviceBusTopics 计数Count 总计Total IoT 中心路由成功将消息传送到服务总线主题终结点的次数。The number of times IoT Hub routing successfully delivered messages to Service Bus topic endpoints. None
路由:消息传送到回退路由的次数Routing: messages delivered to fallback d2c.telemetry.egress.fallbackd2c.telemetry.egress.fallback 计数Count 总计Total IoT 中心路由将消息传送到与回退路由关联的终结点的次数。The number of times IoT Hub routing delivered messages to the endpoint associated with the fallback route. None
路由:消息传送到消息/事件的次数Routing: messages delivered to messages/events d2c.endpoints.egress.builtIn.eventsd2c.endpoints.egress.builtIn.events 计数Count 总计Total IoT 中心路由成功将消息传送到内置终结点(消息/事件)以及回退路由的次数。The number of times IoT Hub routing successfully delivered messages to the built-in endpoint (messages/events) and fallback route. None
路由:消息传送到存储的次数Routing: messages delivered to storage d2c.endpoints.egress.storaged2c.endpoints.egress.storage 计数Count 总计Total IoT 中心路由成功将消息传送到存储终结点的次数。The number of times IoT Hub routing successfully delivered messages to storage endpoints. None
路由:遥测消息传送次数Routing: telemetry messages delivered d2c.telemetry.egress.successd2c.telemetry.egress.success 计数Count 总计Total 使用 IoT 中心路由将消息成功传送到所有终结点的次数。The number of times messages were successfully delivered to all endpoints using IoT Hub routing. 如果某条消息已路由到多个终结点,则每成功传送一次,此值就会加 1。If a message is routed to multiple endpoints, this value increases by one for each successful delivery. 如果某条消息多次路由到同一终结点,则每成功传送一次,此值就会加 1。If a message is delivered to the same endpoint multiple times, this value increases by one for each successful delivery. None
路由:遥测消息删除次数Routing: telemetry messages dropped d2c.telemetry.egress.droppedd2c.telemetry.egress.dropped 计数Count 总计Total 由于终结点消亡,IoT 中心路由删除消息的次数。The number of times messages were dropped by IoT Hub routing due to dead endpoints. 此值不会统计已传送到回退路由的消息,因为已删除的消息不会传送到回退路由。This value does not count messages delivered to fallback route as dropped messages are not delivered there. None
路由:遥测消息不兼容Routing: telemetry messages incompatible d2c.telemetry.egress.invalidd2c.telemetry.egress.invalid 计数Count 总计Total 消息由于与终结点不兼容而无法由 IoT 中心路由传送的次数。The number of times IoT Hub routing failed to deliver messages due to an incompatibility with the endpoint. 当 IoT 中心尝试将消息传递到终结点时,消息与终结点不兼容,传递失败并收到非暂时性错误。A message is incompatible with an endpoint when Iot Hub attempts to deliver the message to an endpoint and it fails with a non-transient error. 不会重试无效的消息。Invalid messages are not retried. 此值不包括重试次数。This value does not include retries. None
路由:遥测消息孤立次数Routing: telemetry messages orphaned d2c.telemetry.egress.orphanedd2c.telemetry.egress.orphaned 计数Count 总计Total 禁用路由消息时,IoT 中心路由孤立了次数消息,因为它们与任何路由查询都不匹配。The number of times messages were orphaned by IoT Hub routing because they didn't match any routing query, when fallback route is disabled. None

对于“计价单位”值为“计数”的指标,只有总计(总和)聚合有效 。For metrics with a Unit value of Count, only total (sum) aggregation is valid. 最小值、最大值和平均值聚合始终返回 1。Minimum, maximum, and average aggregations always return 1. 有关详细信息,请参阅支持的聚合For more information, see Supported aggregations.

孪生查询指标Twin query metrics

指标显示名称Metric Display Name 指标Metric 计价单位Unit 聚合类型Aggregation Type 说明Description 维度Dimensions
失败的孪生查询数Failed twin queries twinQueries.failuretwinQueries.failure 计数Count 总计Total 所有失败孪生查询的计数。The count of all failed twin queries. None
成功的孪生查询数Successful twin queries twinQueries.successtwinQueries.success 计数Count 总计Total 所有成功孪生查询的计数。The count of all successful twin queries. None
孪生查询结果大小Twin queries result size twinQueries.resultSizetwinQueries.resultSize 字节Bytes 平均值Average 所有成功的孪生查询结果的总大小。The total of the result size of all successful twin queries. None

对于“计价单位”值为“计数”的指标,只有总计(总和)聚合有效 。For metrics with a Unit value of Count, only total (sum) aggregation is valid. 最小值、最大值和平均值聚合始终返回 1。Minimum, maximum, and average aggregations always return 1. 有关详细信息,请参阅支持的聚合For more information, see Supported aggregations.

指标维度Metric dimensions

Azure IoT 中心具有以下与它的一些路由和事件网格指标关联的维度。Azure IoT Hub has the following dimensions associated with some of its routing and event grid metrics.

维度名称Dimension Name 说明Description
EndpointNameEndpointName 端点名称。The endpoint name.
EndpointTypeEndpointType 下列中的一个:eventHubs、serviceBusQueues、cosmosDB、serviceBusTopics 。One of the following: eventHubs, serviceBusQueues, cosmosDB, serviceBusTopics. builtin 或 blobStorage 。builtin, or blobStorage.
EventTypeEventType 以下事件网格事件类型之一:Microsoft.Devices.DeviceCreated。One of the following Event Grid event types: Microsoft.Devices.DeviceCreated. Microsoft.Devices.DeviceDeleted、Microsoft.Devices.DeviceConnected、Microsoft.Devices.DeviceDisconnected 或 Microsoft.Devices.DeviceTelemetry 。Microsoft.Devices.DeviceDeleted, Microsoft.Devices.DeviceConnected, Microsoft.Devices.DeviceDisconnected, or Microsoft.Devices.DeviceTelemetry. 有关详细信息,请参阅事件类型For more information, see Event types.
FailureReasonCategoryFailureReasonCategory 下列中的一个:无效、已删除、已孤立或 null 。One of the following: invalid, dropped, orphaned, or null.
结果Result 成功或失败 。Either success or failure.
RoutingSourceRoutingSource 设备消息Device Messages
孪生更改事件Twin Change Events
设备生命周期事件Device Lifecycle Events

若要了解有关指标维度的详细信息,请参阅多维指标To learn more about metric dimensions, see Multi-dimensional metrics.

资源日志Resource logs

本节列出为 Azure IoT 中心收集的所有资源日志类别类型和架构。This section lists all the resource log category types and schemas collected for Azure IoT Hub. 所有 IoT 中心日志的资源提供程序和类型均为 Microsoft.Devices/IotHubsThe resource provider and type for all IoT Hub logs is Microsoft.Devices/IotHubs.

本节主题Topics in this section

连接Connections

连接类别跟踪设备连接,并断开事件与 IoT 中心和错误的连接。The connections category tracks device connect and disconnect events from an IoT hub as well as errors. 此类别用于识别未经授权的连接尝试或者在失去与设备的连接时发出警报。This category is useful for identifying unauthorized connection attempts and or alerting when you lose connection to devices.

备注

若要获得设备的可靠连接状态,请检查设备检测信号For reliable connection status of devices check Device heartbeat.

{
   "records":
   [
        {
            "time": " UTC timestamp",
            "resourceId": "Resource Id",
            "operationName": "deviceConnect",
            "category": "Connections",
            "level": "Information",
            "properties": "{\"deviceId\":\"<deviceId>\",\"sdkVersion\":\"<sdkVersion>\",\"protocol\":\"<protocol>\",\"authType\":\"{\\\"scope\\\":\\\"device\\\",\\\"type\\\":\\\"sas\\\",\\\"issuer\\\":\\\"iothub\\\",\\\"acceptingIpFilterRule\\\":null}\",\"maskedIpAddress\":\"<maskedIpAddress>\"}",
            "location": "Resource location"
        }
    ]
}

设备遥测Device telemetry

设备遥测类别跟踪在 IoT 中心发生且与遥测管道相关的错误。The device telemetry category tracks errors that occur at the IoT hub and are related to the telemetry pipeline. 此类别包括发送遥测事件(例如限制)和接收遥测事件(例如未经授权的读取者)时发生的错误。This category includes errors that occur when sending telemetry events (such as throttling) and receiving telemetry events (such as unauthorized reader). 此类别无法捕捉设备本身运行的代码所造成的错误。This category cannot catch errors caused by code running on the device itself.

{
    "records":
    [
        {
            "time": "UTC timestamp",
            "resourceId": "Resource Id",
            "operationName": "ingress",
            "category": "DeviceTelemetry",
            "level": "Error",
            "resultType": "Event status",
            "resultDescription": "MessageDescription",
            "properties": "{\"deviceId\":\"<deviceId>\",\"batching\":\"0\",\"messageSizeInBytes\":\"<messageSizeInBytes>\",\"EventProcessedUtcTime\":\"<UTC timestamp>\",\"EventEnqueuedUtcTime\":\"<UTC timestamp>\",\"partitionId\":\"1\"}", 
            "location": "Resource location"
        }
    ]
}

云到设备的命令Cloud-to-device commands

云到设备的命令类别跟踪在 IoT 中心发生且与云到设备的消息管道相关的错误。The cloud-to-device commands category tracks errors that occur at the IoT hub and are related to the cloud-to-device message pipeline. 此类别包括在以下情况下发生的错误:This category includes errors that occur from:

  • 发送云到设备消息时(例如“未经授权的发件人”错误),Sending cloud-to-device messages (like unauthorized sender errors),
  • 接收云到设备消息时(例如“超出传递计数”错误),以及Receiving cloud-to-device messages (like delivery count exceeded errors), and
  • 接收云到设备消息反馈时(例如“反馈已过期”错误)。Receiving cloud-to-device message feedback (like feedback expired errors).

此类别不捕捉当云到设备消息已成功传递但设备未正确进行处理时出现的错误。This category does not catch errors when the cloud-to-device message is delivered successfully but then improperly handled by the device.

{
    "records":
    [
        {
            "time": " UTC timestamp",
            "resourceId": "Resource Id",
            "operationName": "messageExpired",
            "category": "C2DCommands",
            "level": "Error",
            "resultType": "Event status",
            "resultDescription": "MessageDescription",
            "properties": "{\"deviceId\":\"<deviceId>\",\"messageId\":\"<messageId>\",\"messageSizeInBytes\":\"<messageSize>\",\"protocol\":\"Amqp\",\"deliveryAcknowledgement\":\"<None, NegativeOnly, PositiveOnly, Full>\",\"deliveryCount\":\"0\",\"expiryTime\":\"<timestamp>\",\"timeInSystem\":\"<timeInSystem>\",\"ttl\":<ttl>, \"EventProcessedUtcTime\":\"<UTC timestamp>\",\"EventEnqueuedUtcTime\":\"<UTC timestamp>\", \"maskedIpAddress\": \"<maskedIpAddress>\", \"statusCode\": \"4XX\"}",
            "location": "Resource location"
        }
    ]
}

设备标识操作Device identity operations

设备标识操作类别跟踪你尝试在其 IoT 中心的标识注册表中创建、更新或删除条目时所发生的错误。The device identity operations category tracks errors that occur when you attempt to create, update, or delete an entry in your IoT hub's identity registry. 预配方案就很适合跟踪此类别。Tracking this category is useful for provisioning scenarios.

{
    "records":
    [
        {
            "time": "UTC timestamp",
            "resourceId": "Resource Id",
            "operationName": "get",
            "category": "DeviceIdentityOperations",
            "level": "Error",
            "resultType": "Event status",
            "resultDescription": "MessageDescription",
            "properties": "{\"maskedIpAddress\":\"<maskedIpAddress>\",\"deviceId\":\"<deviceId>\", \"statusCode\":\"4XX\"}",
            "location": "Resource location"
        }
    ]
}

文件上传操作File upload operations

文件上传类别跟踪在 IoT 中心发生且与文件上传功能相关的错误。The file upload category tracks errors that occur at the IoT hub and are related to file upload functionality. 此类别包括:This category includes:

  • SAS URI 发生的错误,例如它在设备就上传完毕通知中心之前到期。Errors that occur with the SAS URI, such as when it expires before a device notifies the hub of a completed upload.

  • 设备报告的失败上传。Failed uploads reported by the device.

  • 创建 IoT 中心通知消息期间在存储中找不到文件时发生的错误。Errors that occur when a file is not found in storage during IoT Hub notification message creation.

此类别不能捕获在设备将文件上传到存储时直接发生的错误。This category cannot catch errors that directly occur while the device is uploading a file to storage.

{
    "records":
    [
        {
            "time": "UTC timestamp",
            "resourceId": "Resource Id",
            "operationName": "ingress",
            "category": "FileUploadOperations",
            "level": "Error",
            "resultType": "Event status",
            "resultDescription": "MessageDescription",
            "durationMs": "1",
            "properties": "{\"deviceId\":\"<deviceId>\",\"protocol\":\"<protocol>\",\"authType\":\"{\\\"scope\\\":\\\"device\\\",\\\"type\\\":\\\"sas\\\",\\\"issuer\\\":\\\"iothub\\\",\\\"acceptingIpFilterRule\\\":null}\",\"blobUri\":\"http//bloburi.com\"}",
            "location": "Resource location"
        }
    ]
}

路由Routes

消息路由类别跟踪消息路由评估期间发生的错误以及 IoT 中心感知到的终结点运行状况。The message routing category tracks errors that occur during message route evaluation and endpoint health as perceived by IoT Hub. 此类别包括诸如下列项的事件:This category includes events such as:

  • 规则评估结果为“未定义”,A rule evaluates to "undefined",
  • IoT 中心将某个终结点标记为死终结点,或者IoT Hub marks an endpoint as dead, or
  • 从终结点收到的任何错误。Any errors received from an endpoint.

此类别不包含有关消息本身的特定错误(例如设备限制错误),这些错误在“设备遥测”类别下报告。This category does not include specific errors about the messages themselves (like device throttling errors), which are reported under the "device telemetry" category.

{
    "records":
    [
        {
            "time":"2019-12-12T03:25:14Z",
            "resourceId":"/SUBSCRIPTIONS/91R34780-3DEC-123A-BE2A-213B5500DFF0/RESOURCEGROUPS/ANON-TEST/PROVIDERS/MICROSOFT.DEVICES/IOTHUBS/ANONHUB1",
            "operationName":"endpointUnhealthy",
            "category":"Routes",
            "level":"Error",
            "resultType":"403004",
            "resultDescription":"DeviceMaximumQueueDepthExceeded",
            "properties":"{\"deviceId\":null,\"endpointName\":\"anon-sb-1\",\"messageId\":null,\"details\":\"DeviceMaximumQueueDepthExceeded\",\"routeName\":null,\"statusCode\":\"403\"}",
            "location":"chinaeast"
        }
    ]
}

以下是有关路由资源日志的更多详细信息:Here are more details on routing resource logs:

设备到云孪生操作Device-to-cloud twin operations

设备到云孪生操作类别跟踪设备孪生上设备发起的事件。The device-to-cloud twin operations category tracks device-initiated events on device twins. 这些操作可能包括获取孪生、更新报告属性和订阅所需属性。These operations can include get twin, update reported properties, and subscribe to desired properties.

{
    "records":
    [
        {
            "time": "UTC timestamp",
            "resourceId": "Resource Id",
            "operationName": "update",
            "category": "D2CTwinOperations",
            "level": "Information",
            "durationMs": "1",
            "properties": "{\"deviceId\":\"<deviceId>\",\"protocol\":\"<protocol>\",\"authenticationType\":\"{\\\"scope\\\":\\\"device\\\",\\\"type\\\":\\\"sas\\\",\\\"issuer\\\":\\\"iothub\\\",\\\"acceptingIpFilterRule\\\":null}\"}",
            "location": "Resource location"
        }
    ]
}

云到设备孪生操作Cloud-to-device twin operations

云到设备孪生操作类别跟踪设备孪生上服务发起的事件。The cloud-to-device twin operations category tracks service-initiated events on device twins. 这些操作可能获取孪生、更新或替换标记,以及更新或替换所需属性。These operations can include get twin, update or replace tags, and update or replace desired properties.

{
    "records":
    [
        {
            "time": "UTC timestamp",
            "resourceId": "Resource Id",
            "operationName": "read",
            "category": "C2DTwinOperations",
            "level": "Information",
            "durationMs": "1",
            "properties": "{\"deviceId\":\"<deviceId>\",\"sdkVersion\":\"<sdkVersion>\",\"messageSize\":\"<messageSize>\"}",
            "location": "Resource location"
        }
    ]
}

孪生查询Twin queries

孪生查询类别报告在云中针对设备孪生发起的查询请求。The twin queries category reports on query requests for device twins that are initiated in the cloud.

{
    "records":
    [
        {
            "time": "UTC timestamp",
            "resourceId": "Resource Id",
            "operationName": "query",
            "category": "TwinQueries",
            "level": "Information",
            "durationMs": "1",
            "properties": "{\"query\":\"<twin query>\",\"sdkVersion\":\"<sdkVersion>\",\"messageSize\":\"<messageSize>\",\"pageSize\":\"<pageSize>\", \"continuation\":\"<true, false>\", \"resultSize\":\"<resultSize>\"}",
            "location": "Resource location"
        }
    ]
}

作业操作Jobs operations

作业操作类别报告在多个设备上更新设备孪生或调用直接方法的作业请求。The jobs operations category reports on job requests to update device twins or invoke direct methods on multiple devices. 这些请求在云中发起。These requests are initiated in the cloud.

{
    "records":
    [
        {
            "time": "UTC timestamp",
            "resourceId": "Resource Id",
            "operationName": "jobCompleted",
            "category": "JobsOperations",
            "level": "Information",
            "durationMs": "1",
            "properties": "{\"jobId\":\"<jobId>\", \"sdkVersion\": \"<sdkVersion>\",\"messageSize\": <messageSize>,\"filter\":\"DeviceId IN ['1414ded9-b445-414d-89b9-e48e8c6285d5']\",\"startTimeUtc\":\"Wednesday, September 13, 2017\",\"duration\":\"0\"}",
            "location": "Resource location"
        }
    ]
}

直接方法Direct Methods

直接方法类别跟踪发送到单个设备的请求-响应交互。The direct methods category tracks request-response interactions sent to individual devices. 这些请求在云中发起。These requests are initiated in the cloud.

{
    "records":
    [
        {
            "time": "UTC timestamp",
            "resourceId": "Resource Id",
            "operationName": "send",
            "category": "DirectMethods",
            "level": "Information",
            "durationMs": "1",
            "properties": "{\"deviceId\":<messageSize>, \"RequestSize\": 1, \"ResponseSize\": 1, \"sdkVersion\": \"2017-07-11\"}",
            "location": "Resource location"
        }
    ]
}

配置Configurations

IoT 中心配置日志跟踪有关自动设备管理功能集的事件和错误。IoT Hub configuration logs track events and error for the Automatic Device Management feature set.

{
    "records":
    [
         {
             "time": "2019-09-24T17:21:52Z",
             "resourceId": "Resource Id",
             "operationName": "ReadManyConfigurations",
             "category": "Configurations",
             "resultType": "",
             "resultDescription": "",
             "level": "Information",
             "durationMs": "17",
             "properties": "{\"configurationId\":\"\",\"sdkVersion\":\"2018-06-30\",\"messageSize\":\"0\",\"statusCode\":null}",
             "location": "southcentralus"
         }
    ]
}

设备流(预览版)Device Streams (Preview)

设备流类别跟踪发送到单个设备的请求-响应交互。The device streams category tracks request-response interactions sent to individual devices.

{
    "records":
    [
         {
             "time": "2019-09-19T11:12:04Z",
             "resourceId": "Resource Id",
             "operationName": "invoke",
             "category": "DeviceStreams",
             "resultType": "",
             "resultDescription": "",    
             "level": "Information",
             "durationMs": "74",
             "properties": "{\"deviceId\":\"myDevice\",\"moduleId\":\"myModule\",\"sdkVersion\":\"2019-05-01-preview\",\"requestSize\":\"3\",\"responseSize\":\"5\",\"statusCode\":null,\"requestName\":\"myRequest\",\"direction\":\"c2d\"}",
             "location": "Central US"
         }
    ]
}

Azure Monitor 日志表Azure Monitor Logs tables

本节介绍与 Azure IoT 中心相关并可通过 Log Analytics 进行查询的所有 Azure Monitor 日志 Kusto 表。This section refers to all of the Azure Monitor Logs Kusto tables relevant to Azure IoT Hub and available for query by Log Analytics. 有关这些表的列表以及指向 IoT 中心资源类型的详细信息的链接,请参阅 Azure Monitor 日志表参考中的 IoT 中心For a list of these tables and links to more information for the IoT Hub resource type, see IoT Hub in the Azure Monitor Logs table reference.

有关所有 Azure Monitor 日志/Log Analytics 表的参考,请参阅 Azure Monitor 日志表参考For a reference of all Azure Monitor Logs / Log Analytics tables, see the Azure Monitor Log Table Reference.

另请参阅See Also