I have an Azure IoT device connected to an Azure IoT Hub. The device sends 6 - 7 messages per minute. By looking at the D2C message metrics, I found an outlier, that states that at a specific time, the count of the D2C message was zero (see picture). As the messages are routed to a storage, I can check the storage to see if there are messages missing at that specific time, but the data saved in the storage shows that every message was received correctly at that time. Does any one know how that comes or if the metrics are not that reliable generally? If that's the case, what is the best practice to monitor the IoT Hub message transfer?
0
votes
A transient error may have occurred in Azure Monitor or the message may have been delivered later to your endpoint - In storage can you see the date\time it was written?
– asergaz
I encountered sometimes network issues that caused delays in the message delivery, and that can be seen by the date\time in the storage, just like you said. But this one is unusual, because the timestamp in the storage looks very normal.
– WLin
I added the EnqueuedTimeUtc field of the stored data to my question. Both metrics graph and the stored data are using UTC.
– WLin
You will need to use a more robust way to identify those delays and correlate D2C messages between different services on Azure. Can you try and Trace Azure IoT device-to-cloud messages with distributed tracing (currently in preview) ?
– asergaz
1 Answers
0
votes
For precisely monitor the flow of each message through IoT Hub you will need to Trace Azure IoT device-to-cloud messages with distributed tracing (currently in preview)
- This trace context includes correlation IDs that allow you to correlate events from one component with events from another component
- Automatically log the trace context to Azure Monitor Logs.
- Measure and understand message flow and latency from devices to IoT Hub and routing endpoints.
Ref: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-distributed-tracing