I have setup IoT Edge up in one of our machines and installed OPC Publisher and connected it to one of our opc-ua servers which then sends data to OPC Publisher and then to IoT Hub. We have not received any data to our IoT hub for the last 10 days and suddenly today we have received the data. How can we troubleshoot why the data is missing for the last 10 days?
2 Answers
One of the most powerful tools to monitor your edge deployments is the integration with Azure Monitor. It will collect metrics from the edgeHub and edgeAgent, which combined will give you an overview of where your messages are going. It can show you how many messages are sent to your upstream endpoint and when.
For a full overview of the capabilities, you can check out this blog post. Installation steps are here
Edit:
OPC Publisher aLso supports diagnostic logging, which will give you more information about the connections to OPC servers. To do this, you need to set the diagnostic interval. You can do this by specifying the --di
command argument in your createOptions:
"OPCPublisher":{
"settings":{
"image":"<image>",
"createOptions":{
"Cmd":["di=60"]
}
},
"type":"docker",
"version":"1.0",
"status":"running",
"restartPolicy":"always"
}
The example above will log diagnostic metrics every 60 seconds. You can then upload the logs using the support bundle command from Cristian's answer, or use the UploadSupportBundle direct method to do the same without needing access to the device.

- 3,865
- 2
- 12
- 22
-
I don't see the Metrics Collector Module, I only see IoT Edge Hub, IoT Edge Agent, OPC Publisher Module. – Maryo David Oct 29 '21 at 17:13
-
You'll need to include it in your deployment. Check the installation steps for instructions. – Matthijs van der Veer Oct 30 '21 at 07:32
-
One last query, is there a configuration file in IOT Edge Device where I can check from which OPC Server my OPCPublisher is receiving the telemetry? – Maryo David Nov 02 '21 at 19:06
-
You can enable diagnostic logging on the module. I have updated my answer to include those details as well. – Matthijs van der Veer Nov 06 '21 at 06:01
You can generate a support bundle on your edge device that will collect the logs of all deployed modules as well as the edge runtime logs.
sudo iotedge support-bundle --since 11d
More details on troubleshooting IoT Edge here
You can first look into the logs of the publisher and validate if the connection to the OPC UA Server was/is active. If this is fine then have a look into the edgeHub and validate if the upstream connectivity to IoT Hub was affected.

- 21
- 2
-
Is there a way to get logs for a specific date ? i.e say 10th October 2021 – Maryo David Oct 29 '21 at 17:12
-