了解 IoT 中心指标Understand IoT Hub metrics

IoT 中心度量值提供更棒的数据,清晰显示 Azure 订阅中的 Azure IoT 资源状态。IoT Hub metrics give you better data about the state of the Azure IoT resources in your Azure subscription. 通过 IoT 中心度量值,可评估 IoT 中心服务及其所连接的设备的总体运行状况。IoT Hub metrics enable you to assess the overall health of the IoT Hub service and the devices connected to it. 面向用户的统计信息非常重要,因为它们可以帮助了解 IoT 中心的情况,并可以帮助在不联系 Azure 支持人员的情况下解决根本问题。User-facing statistics are important because they help you see what is going on with your IoT hub and help root-cause 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
d2c.telemetry.ingress.allProtocold2c.telemetry.ingress.allProtocol 遥测消息发送尝试次数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.successd2c.telemetry.ingress.success 发送的遥测消息数Telemetry messages sent 计数Count 总计Total 成功发送到 IoT 中心的、设备到云的遥测消息数Number of device-to-cloud telemetry messages sent successfully to your IoT hub None
c2d.commands.egress.complete.successc2d.commands.egress.complete.success 已完成的 C2D 消息传递次数C2D message deliveries completed 计数Count 总计Total 设备成功完成的云到设备消息传递次数Number of cloud-to-device message deliveries completed successfully by the device None
c2d.commands.egress.abandon.successc2d.commands.egress.abandon.success 丢弃的 C2D 消息数C2D messages abandoned 计数Count 总计Total 设备丢弃的云到设备消息数Number of cloud-to-device messages abandoned by the device None
c2d.commands.egress.reject.successc2d.commands.egress.reject.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.allProtocoldevices.connectedDevices.allProtocol 连接的设备数(已弃用)Connected devices (deprecated) 计数Count 总计Total 已连接到 IoT 中心的设备数目Number of devices connected to your IoT hub None
d2c.telemetry.egress.successd2c.telemetry.egress.success 路由:遥测消息传送次数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.droppedd2c.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.orphanedd2c.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 rules (including the fallback rule).  None
d2c.telemetry.egress.invalidd2c.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. 此值不包括重试次数。This value does not include retries. None
d2c.telemetry.egress.fallbackd2c.telemetry.egress.fallback 路由:消息传送到回退路由的次数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.eventHubsd2c.endpoints.egress.eventHubs 路由:消息传送到事件中心的次数Routing: messages delivered to Event Hub 计数Count 总计Total IoT 中心路由成功将消息传送到事件中心终结点的次数。The number of times IoT Hub routing successfully delivered messages to Event Hub endpoints. None
d2c.endpoints.latency.eventHubsd2c.endpoints.latency.eventHubs 路由:事件中心的消息延迟Routing: message latency for Event Hub 毫秒Milliseconds 平均值Average 消息进入 IoT 中心与进入事件中心终结点之间的平均延迟(毫秒)The average latency (milliseconds) between message ingress to IoT Hub and message ingress into an Event Hub endpoint. None
d2c.endpoints.egress.serviceBusQueuesd2c.endpoints.egress.serviceBusQueues 路由:消息传送到服务总线队列的次数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.serviceBusQueuesd2c.endpoints.latency.serviceBusQueues 路由:服务总线队列的消息延迟Routing: message latency for Service Bus Queue 毫秒Milliseconds 平均值Average 消息进入 IoT 中心与遥测消息进入服务总线队列终结点之间的平均延迟(毫秒)The average latency (milliseconds) between message ingress to IoT Hub and telemetry message ingress into a Service Bus queue endpoint. None
d2c.endpoints.egress.serviceBusTopicsd2c.endpoints.egress.serviceBusTopics 路由:消息传送到服务总线主题的次数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.serviceBusTopicsd2c.endpoints.latency.serviceBusTopics 路由:服务总线主题的消息延迟Routing: message latency for Service Bus Topic 毫秒Milliseconds 平均值Average 消息进入 IoT 中心与遥测消息进入服务总线主题终结点之间的平均延迟(毫秒)The average latency (milliseconds) between message ingress to IoT Hub and telemetry message ingress into a Service Bus topic endpoint. None
d2c.endpoints.egress.builtIn.eventsd2c.endpoints.egress.builtIn.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). None
d2c.endpoints.latency.builtIn.eventsd2c.endpoints.latency.builtIn.events 路由:消息/事件的消息延迟Routing: message latency for messages/events 毫秒Milliseconds 平均值Average 消息进入 IoT 中心与遥测消息进入内置终结点(消息/事件)之间的平均延迟(毫秒)The average latency (milliseconds) between message ingress to IoT Hub and telemetry message ingress into the built-in endpoint (messages/events). None
d2c.endpoints.egress.storaged2c.endpoints.egress.storage 路由:消息传送到存储的次数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.storaged2c.endpoints.latency.storage 路由:存储的消息延迟Routing: message latency for storage 毫秒Milliseconds 平均值Average 消息进入 IoT 中心与遥测消息进入存储终结点之间的平均延迟(毫秒)。The average latency (milliseconds) between message ingress to IoT Hub and telemetry message ingress into a storage endpoint. None
d2c.endpoints.egress.storage.bytesd2c.endpoints.egress.storage.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.storage.blobsd2c.endpoints.egress.storage.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 average, min, and max 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 average, min, and max 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 average, min, and max of all successful direct method requests. None
c2d.methods.responseSizec2d.methods.responseSize 直接方法调用的响应大小Response size of direct method invocations 字节Bytes 平均值Average 所有成功直接方法响应的平均、最小和最大大小。The average, min, and max 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 average, min, and max 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 average, min, and max 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 average, min, and max of the result size of all successful twin queries. None
jobs.createTwinUpdateJob.successjobs.createTwinUpdateJob.success 孪生更新作业创建成功数Successful creations of twin update jobs 计数Count 总计Total 孪生更新作业创建成功的所有次数。The count of all successful creation of twin update jobs. None
jobs.createTwinUpdateJob.failurejobs.createTwinUpdateJob.failure 孪生更新作业创建失败数Failed creations of twin update jobs 计数Count 总计Total 孪生更新作业创建失败的所有次数。The count of all failed creation of twin update jobs. None
jobs.createDirectMethodJob.successjobs.createDirectMethodJob.success 方法调用作业的创建成功数Successful creations of method invocation jobs 计数Count 总计Total 直接方法调用作业创建成功的所有次数。The count of all successful creation of direct method invocation jobs. None
jobs.createDirectMethodJob.failurejobs.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.sendThrottled2c.telemetry.ingress.sendThrottle 限制错误数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 配置操作的指标Metrics for Configuration Operations None

后续步骤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: