I need to make device's uptime statistics. I want to get information about connections/disconnections from logs, but I don't know what is the best way to log these event from IoT hub.
I've already tried:
- Event grid. Not very good because: "order of events is not guaranteed" according to the documentation.
- Diagnostics in IoT hub: "The events emitted by the IoT Hub service using Azure Monitor diagnostic logs are not guaranteed to be reliable or ordered. Some events might be lost or delivered out of order."
- Device heartbeat: from documentation: "Only use the connectionState field during development and debugging".
- Function application or Logic app: how to trigger by connecting/disconnecting?
What else can I try?