Azure IoT 中心 Java 获取设备的流量统计信息

Azure IoT Hub Java get traffic statistics for a device

我有一个 Azure Iot Hub 设置,其中连接了一些设备和 Java 服务。我希望能够检索流量统计信息(即特定时间内设备到云消息的数量 window)。

Azure 门户能够显示总体流量数据(但不能按设备显示),但我没有找到任何访问该数据的方法,也没有看到每个设备的流量明细门户网站。

我查看了 Azure 支持的 REST API,包括 Java Azure SDK,但找不到与 IoT 网络流量相关的任何内容。

Azure IoT Hub's metrics (the data you see on the portal) cannot be broken down to a device level directly. To get traffic statistics for a device or a set of devices, you would need to set up an additional service to consume and count the messages. One way to do it is to use Azure Stream Analytics 并使用 IoTHub.ConnectionDeviceId 字段计算消息数。