了解 IoT 中心指标Understand IoT Hub metrics

IoT 中心度量值提供有关 Azure 订阅中的 Azure IoT 资源状态的信息。IoT Hub metrics give you information about the state of the Azure IoT resources in your Azure subscription. IoT 中心度量值可帮助评估 IoT 中心服务及其所连接的设备的总体运行状况。IoT Hub metrics help you assess the overall health of the IoT Hub service and the devices connected to it. 这些面向用户的统计信息可以帮助了解 IoT 中心的情况,并可以帮助在不需要联系 Azure 支持的情况下对问题执行根本原因分析。These user-facing statistics help you see what is going on with your IoT hub and help perform root-cause analysis on issues without needing to contact Azure support.

默认启用度量值。Metrics are enabled by default. 可在 Azure 门户中查看 IoT 中心度量值。You can view IoT Hub metrics from the Azure portal.

如何查看 IoT 中心度量值How to view IoT Hub metrics

  1. 创建 IoT 中心。Create an IoT hub. 可以在从设备向 IoT 中心发送遥测数据指南中找到有关如何创建 IoT 中心的说明。You can find instructions on how to create an IoT hub in the Send telemetry from a device to IoT Hub guide.

  2. 打开 IoT 中心的边栏选项卡。Open the blade of your IoT hub. 在此处单击“度量值” 。From there, click Metrics.

    显示指标选项在 IoT 中心资源页中位置的屏幕截图

  3. 在“度量值”边栏选项卡中,可查看 IoT 中心的度量值并创建度量值的自定义视图。From the metrics blade, you can view the metrics for your IoT hub and create custom views of your metrics.

    显示 IoT 中心的指标页的屏幕截图

  4. 可以选择将指标数据发送到事件中心终结点还是 Azure 存储帐户,方法是单击“诊断设置” ,然后单击“添加诊断设置” You can choose to send your metrics data to an Event Hubs endpoint or an Azure Storage account by clicking Diagnostics settings, then Add diagnostic setting

    显示“诊断设置”按钮所在位置的屏幕截图

IoT 中心度量值及其用法IoT Hub metrics and how to use them

IoT 中心提供多个度量值,帮助你大致了解中心的运行状况以及所连接的设备总数。IoT Hub provides several metrics to give you an overview of the health of your hub and the total number of connected devices. 可以结合多个度量值的信息,更清楚地了解 IoT 中心的状态。You can combine information from multiple metrics to paint a bigger picture of the state of the IoT hub. 下表描述了每个 IoT 中心所跟踪的度量值,以及每个度量值与 IoT 中心总体状态的关联。The following table describes the metrics each IoT hub tracks, and how each metric relates to the overall status of the IoT hub.

指标Metric 指标显示名称Metric Display Name 计价单位Unit 聚合类型Aggregation Type 说明Description 维度Dimensions
RoutingDeliveriesRoutingDeliveries 路由传递尝试次数(预览版)Routing Delivery Attempts (preview) 计数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. ResourceID、ResourceID,
Result、Result,
RoutingSource、RoutingSource,
EndpointType、EndpointType,
FailureReasonCategory、FailureReasonCategory,
EndpointNameEndpointName
有关维度的更多详细信息请参阅此处More details on dimensions here.
RoutingDeliveryLatencyRoutingDeliveryLatency 路由延迟(预览版)Routing Latency (preview) 毫秒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. ResourceID、ResourceID,
RoutingSource、RoutingSource,
EndpointType、EndpointType,
EndpointNameEndpointName
有关维度的更多详细信息请参阅此处More details on dimensions here.
RoutingDataSizeInBytesDeliveredRoutingDataSizeInBytesDelivered 路由传递数据大小(以字节为单位)(预览版)Routing Delivery Data Size In Bytes (preview) 字节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. ResourceID、ResourceID,
RoutingSource、RoutingSource,
EndpointTypeEndpointType
EndpointNameEndpointName
有关维度的更多详细信息请参阅此处More details on dimensions here.
d2c.telemetry.ingress.d2c.telemetry.ingress.
allProtocolallProtocol
遥测消息发送尝试次数Telemetry message send attempts 计数Count 总计Total 尝试发送到 IoT 中心的、设备到云的遥测消息数Number of device-to-cloud telemetry messages attempted to be sent to your IoT hub None
d2c.telemetry.ingress.d2c.telemetry.ingress.
successsuccess
发送的遥测消息数Telemetry messages sent 计数Count 总计Total 成功发送到 IoT 中心的、设备到云的遥测消息数Number of device-to-cloud telemetry messages sent successfully to your IoT hub None
c2d.commands.egress.c2d.commands.egress.
complete.successcomplete.success
已完成的 C2D 消息传递次数C2D message deliveries completed 计数Count 总计Total 设备成功完成的云到设备消息传递次数Number of cloud-to-device message deliveries completed successfully by the device None
c2d.commands.egress.c2d.commands.egress.
abandon.successabandon.success
丢弃的 C2D 消息数C2D messages abandoned 计数Count 总计Total 设备丢弃的云到设备消息数Number of cloud-to-device messages abandoned by the device None
c2d.commands.egress.c2d.commands.egress.
reject.successreject.success
拒绝的 C2D 消息数C2D messages rejected 计数Count 总计Total 设备拒绝的云到设备消息数Number of cloud-to-device messages rejected by the device None
C2DMessagesExpiredC2DMessagesExpired 过期的 C2D 消息数(预览版)C2D Messages Expired (preview) 计数Count 总计Total 过期的云到设备消息数Number of expired cloud-to-device messages None
devices.totalDevicesdevices.totalDevices 设备总数(已弃用)Total devices (deprecated) 计数Count 总计Total 已注册到 IoT 中心的设备数目Number of devices registered to your IoT hub None
devices.connectedDevices.devices.connectedDevices.
allProtocolallProtocol
连接的设备数(已弃用)Connected devices (deprecated) 计数Count 总计Total 已连接到 IoT 中心的设备数目Number of devices connected to your IoT hub None
d2c.telemetry.egress.d2c.telemetry.egress.
successsuccess
路由:遥测消息传送次数Routing: telemetry messages delivered 计数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
d2c.telemetry.egress.d2c.telemetry.egress.
已删除dropped
路由:遥测消息删除次数Routing: telemetry messages 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
d2c.telemetry.egress.d2c.telemetry.egress.
已孤立orphaned
路由:遥测消息孤立次数Routing: telemetry messages 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
d2c.telemetry.egress.d2c.telemetry.egress.
无效invalid
路由:遥测消息不兼容Routing: telemetry messages incompatible 计数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 an non transient error. 不会重试无效的消息。Invalid messages are not retried. 此值不包括重试次数。This value does not include retries. None
d2c.telemetry.egress.d2c.telemetry.egress.
.fallbackfallback
路由:消息传送到回退路由的次数Routing: messages delivered to fallback 计数Count 总计Total IoT 中心路由将消息传送到与回退路由关联的终结点的次数。The number of times IoT Hub routing delivered messages to the endpoint associated with the fallback route. None
d2c.endpoints.egress.d2c.endpoints.egress.
.eventHubseventHubs
路由:消息传送到事件中心的次数Routing: messages delivered to Event Hub 计数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
d2c.endpoints.latency.d2c.endpoints.latency.
.eventHubseventHubs
路由:事件中心的消息延迟Routing: message latency for Event Hub 毫秒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
d2c.endpoints.egress.d2c.endpoints.egress.
serviceBusQueuesserviceBusQueues
路由:消息传送到服务总线队列的次数Routing: messages delivered to Service Bus Queue 计数Count 总计Total IoT 中心路由成功将消息传送到服务总线队列终结点的次数。The number of times IoT Hub routing successfully delivered messages to Service Bus queue endpoints. None
d2c.endpoints.latency.d2c.endpoints.latency.
serviceBusQueuesserviceBusQueues
路由:服务总线队列的消息延迟Routing: message latency for Service Bus Queue 毫秒Milliseconds 平均值Average 消息进入 IoT 中心与消息进入服务总线队列终结点之间的平均延迟(毫秒)。The average latency (milliseconds) between message ingress to IoT Hub and message ingress into a Service Bus queue endpoint. None
d2c.endpoints.egress.d2c.endpoints.egress.
serviceBusTopicsserviceBusTopics
路由:消息传送到服务总线主题的次数Routing: messages delivered to Service Bus Topic 计数Count 总计Total IoT 中心路由成功将消息传送到服务总线主题终结点的次数。The number of times IoT Hub routing successfully delivered messages to Service Bus topic endpoints. None
d2c.endpoints.latency.d2c.endpoints.latency.
serviceBusTopicsserviceBusTopics
路由:服务总线主题的消息延迟Routing: message latency for Service Bus Topic 毫秒Milliseconds 平均值Average 消息进入 IoT 中心与消息进入服务总线主题终结点之间的平均延迟(毫秒)。The average latency (milliseconds) between message ingress to IoT Hub and message ingress into a Service Bus topic endpoint. None
d2c.endpoints.egress.d2c.endpoints.egress.
builtIn.eventsbuiltIn.events
路由:消息传送到消息/事件的次数Routing: messages delivered to messages/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
d2c.endpoints.latency.d2c.endpoints.latency.
builtIn.eventsbuiltIn.events
路由:消息/事件的消息延迟Routing: message latency for messages/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
d2c.endpoints.egress.d2c.endpoints.egress.
storagestorage
路由:消息传送到存储的次数Routing: messages delivered to storage 计数Count 总计Total IoT 中心路由成功将消息传送到存储终结点的次数。The number of times IoT Hub routing successfully delivered messages to storage endpoints. None
d2c.endpoints.latency.d2c.endpoints.latency.
storagestorage
路由:存储的消息延迟Routing: message latency for storage 毫秒Milliseconds 平均值Average 消息进入 IoT 中心与消息进入存储终结点之间的平均延迟(毫秒)。The average latency (milliseconds) between message ingress to IoT Hub and message ingress into a storage endpoint. None
d2c.endpoints.egress.d2c.endpoints.egress.
storage.bytesstorage.bytes
路由:传送到存储的数据量Routing: data delivered to storage 字节Bytes 总计Total IoT 中心路由传送到存储终结点的数据量(字节)。The amount of data (bytes) IoT Hub routing delivered to storage endpoints. None
d2c.endpoints.egress.d2c.endpoints.egress.
storage.blobsstorage.blobs
路由:将 Blob 传送到存储的次数Routing: blobs delivered to storage 计数Count 总计Total IoT 中心路由将 Blob 传送到存储终结点的次数。The number of times IoT Hub routing delivered blobs to storage endpoints. None
EventGridDeliveriesEventGridDeliveries 事件网格传递次数(预览版)Event Grid deliveries(preview) 计数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). ResourceId、ResourceId,
Result、Result,
EventTypeEventType
EventGridLatencyEventGridLatency 事件网格延迟(预览)Event Grid latency (preview) 毫秒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. ResourceId、ResourceId,
EventTypeEventType
d2c.twin.read.successd2c.twin.read.success 设备的成功孪生读取数Successful twin reads from devices 计数Count 总计Total 由设备发起的所有成功孪生读取的计数。The count of all successful device-initiated twin reads. None
d2c.twin.read.failured2c.twin.read.failure 设备的失败孪生读取数Failed twin reads from devices 计数Count 总计Total 由设备发起的所有失败孪生读取的计数。The count of all failed device-initiated twin reads. None
d2c.twin.read.sized2c.twin.read.size 设备的孪生读取的响应大小Response size of twin reads from devices 字节Bytes 平均值Average 由设备发起的所有成功的孪生读取的数量。The number of all successful device-initiated twin reads. None
d2c.twin.update.successd2c.twin.update.success 设备的成功孪生更新数Successful twin updates from devices 计数Count 总计Total 由设备发起的所有成功的孪生更新的计数。The count of all successful device-initiated twin updates. None
d2c.twin.update.failured2c.twin.update.failure 设备的失败孪生更新数Failed twin updates from devices 计数Count 总计Total 由设备发起的所有失败的孪生更新的计数。The count of all failed device-initiated twin updates. None
d2c.twin.update.sized2c.twin.update.size 设备的孪生更新的大小Size of twin updates from devices 字节Bytes 平均值Average 由设备发起的所有成功的孪生更新的总大小。The total size of all successful device-initiated twin updates. None
c2d.methods.successc2d.methods.success 成功的直接方法调用数Successful direct method invocations 计数Count 总计Total 所有成功的直接方法调用的计数。The count of all successful direct method calls. None
c2d.methods.failurec2d.methods.failure 失败的直接方法调用数Failed direct method invocations 计数Count 总计Total 所有失败直接方法调用的计数。The count of all failed direct method calls. None
c2d.methods.requestSizec2d.methods.requestSize 直接方法调用的请求大小Request size of direct method invocations 字节Bytes 平均值Average 所有成功的直接方法请求计数。The count of all successful direct method requests. None
c2d.methods.responseSizec2d.methods.responseSize 直接方法调用的响应大小Response size of direct method invocations 字节Bytes 平均值Average 所有成功的直接方法响应计数。The count of all successful direct method responses. None
c2d.twin.read.successc2d.twin.read.success 后端的成功孪生读取数Successful twin reads from back end 计数Count 总计Total 由后端发起的所有成功孪生读取的计数。The count of all successful back-end-initiated twin reads. None
c2d.twin.read.failurec2d.twin.read.failure 后端的失败孪生读取数Failed twin reads from back end 计数Count 总计Total 由后端发起的所有失败孪生读取的计数。The count of all failed back-end-initiated twin reads. None
c2d.twin.read.sizec2d.twin.read.size 后端的孪生读取的响应大小Response size of twin reads from back end 字节Bytes 平均值Average 由后端发起的所有成功孪生读取的计数。The count of all successful back-end-initiated twin reads. None
c2d.twin.update.successc2d.twin.update.success 后端的成功孪生更新数Successful twin updates from back end 计数Count 总计Total 由后端发起的所有成功孪生更新的计数。The count of all successful back-end-initiated twin updates. None
c2d.twin.update.failurec2d.twin.update.failure 后端的失败孪生更新数Failed twin updates from back end 计数Count 总计Total 由后端发起的所有失败孪生更新的计数。The count of all failed back-end-initiated twin updates. None
c2d.twin.update.sizec2d.twin.update.size 后端的失败孪生更新大小Size of twin updates from back end 字节Bytes 平均值Average 由后端发起的所有成功孪生更新的总大小。The total size of all successful back-end-initiated twin updates. None
twinQueries.successtwinQueries.success 成功的孪生查询数Successful twin queries 计数Count 总计Total 所有成功孪生查询的计数。The count of all successful twin queries. None
twinQueries.failuretwinQueries.failure 失败的孪生查询数Failed twin queries 计数Count 总计Total 所有失败孪生查询的计数。The count of all failed twin queries. None
twinQueries.resultSizetwinQueries.resultSize 孪生查询结果大小Twin queries result size 字节Bytes 平均值Average 所有成功的孪生查询结果的总大小。The total of the result size of all successful twin queries. None
jobs.createTwinUpdateJob.jobs.createTwinUpdateJob.
successsuccess
孪生更新作业创建成功数Successful creations of twin update jobs 计数Count 总计Total 孪生更新作业创建成功的所有次数。The count of all successful creation of twin update jobs. None
jobs.createTwinUpdateJob.jobs.createTwinUpdateJob.
失败failure
孪生更新作业创建失败数Failed creations of twin update jobs 计数Count 总计Total 孪生更新作业创建失败的所有次数。The count of all failed creation of twin update jobs. None
jobs.createDirectMethodJob.jobs.createDirectMethodJob.
successsuccess
方法调用作业的创建成功数Successful creations of method invocation jobs 计数Count 总计Total 直接方法调用作业创建成功的所有次数。The count of all successful creation of direct method invocation jobs. None
jobs.createDirectMethodJob.jobs.createDirectMethodJob.
失败failure
方法调用作业的创建失败数Failed creations of method invocation jobs 计数Count 总计Total 直接方法调用作业创建失败的所有次数。The count of all failed creation of direct method invocation jobs. None
jobs.listJobs.successjobs.listJobs.success 对列出作业的成功调用数Successful calls to list jobs 计数Count 总计Total 对列出作业的所有成功调用的计数。The count of all successful calls to list jobs. None
jobs.listJobs.failurejobs.listJobs.failure 对列出作业的失败调用数Failed calls to list jobs 计数Count 总计Total 对列出作业的所有失败调用的计数。The count of all failed calls to list jobs. None
jobs.cancelJob.successjobs.cancelJob.success 成功的作业取消数Successful job cancellations 计数Count 总计Total 用来取消作业的调用成功的次数。The count of all successful calls to cancel a job. None
jobs.cancelJob.failurejobs.cancelJob.failure 失败的作业取消数Failed job cancellations 计数Count 总计Total 用来取消作业的调用失败的次数。The count of all failed calls to cancel a job. None
jobs.queryJobs.successjobs.queryJobs.success 成功的作业查询数Successful job queries 计数Count 总计Total 对查询作业的所有成功调用的计数。The count of all successful calls to query jobs. None
jobs.queryJobs.failurejobs.queryJobs.failure 失败的作业查询数Failed job queries 计数Count 总计Total 对查询作业的所有失败调用的计数。The count of all failed calls to query jobs. None
jobs.completedjobs.completed 已完成的作业Completed jobs 计数Count 总计Total 所有已完成的作业的计数。The count of all completed jobs. None
jobs.failedjobs.failed 失败的作业数Failed jobs 计数Count 总计Total 所有失败的作业的计数。The count of all failed jobs. None
d2c.telemetry.ingress.d2c.telemetry.ingress.
sendThrottlesendThrottle
限制错误数Number of throttling errors 计数Count 总计Total 由于设备吞吐量限制而导致的限制错误数Number of throttling errors due to device throughput throttles None
dailyMessageQuotaUseddailyMessageQuotaUsed 已使用的消息总数Total number of messages used 计数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
deviceDataUsagedeviceDataUsage 设备数据用量总计Total device data usage 字节Bytes 总计Total 从与 IotHub 相连的任意设备传出的字节,以及传入到与 IotHub 相连的任意设备的字节Bytes transferred to and from any devices connected to IotHub None
deviceDataUsageV2deviceDataUsageV2 设备数据用量总计(预览)Total device data usage (preview) 字节Bytes 总计Total 从与 IotHub 相连的任意设备传出的字节,以及传入到与 IotHub 相连的任意设备的字节Bytes transferred to and from any devices connected to IotHub None
totalDeviceCounttotalDeviceCount 设备总数(预览)Total devices (preview) 计数Count 平均值Average 已注册到 IoT 中心的设备数目Number of devices registered to your IoT hub None
connectedDeviceCountconnectedDeviceCount 连接设备数(预览)Connected devices (preview) 计数Count 平均值Average 已连接到 IoT 中心的设备数目Number of devices connected to your IoT hub None
配置configurations 配置指标Configuration Metrics 计数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

维度Dimensions

维度有助于标识有关指标的更多详细信息。Dimensions help identify more details about the metrics. 某些路由指标提供了每个终结点的信息。Some of the routing metrics provide information per endpoint. 下表列出了这些维度的可能值。Table below lists possible values for these dimensions.

维度Dimension Values
ResourceIDResourceID IoT 中心资源your IoT Hub resource
结果Result successsuccess
失败failure
RoutingSourceRoutingSource 设备消息Device Messages
孪生更改事件Twin Change Events
设备生命周期事件Device Lifecycle Events
EndpointTypeEndpointType eventHubseventHubs
serviceBusQueuesserviceBusQueues
cosmosDBcosmosDB
serviceBusTopicsserviceBusTopics
builtInbuiltin
blobStorageblobStorage
FailureReasonCategoryFailureReasonCategory 无效invalid
已删除dropped
已孤立orphaned
Nullnull
EndpointNameEndpointName 终结点名称endpoint name

后续步骤Next steps

现已大致了解了 IoT 中心度量值,请单击此链接,深入了解如何管理 Azure IoT 中心:Now that you’ve seen an overview of IoT Hub metrics, follow this link to learn more about managing Azure IoT Hub:

若要进一步探索 IoT 中心的功能,请参阅:To further explore the capabilities of IoT Hub, see: