Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: IoT Edge 1.5
Important
IoT Edge 1.5 LTS is the supported release. IoT Edge 1.4 LTS is end of life as of November 12, 2024. If you are on an earlier release, see Update IoT Edge.
Azure IoT Edge gives you real-time information about the modules deployed to your IoT Edge devices. The IoT Hub service gets status from the devices and shows it to you. Monitoring is also important for deployments made at scale that include automatic deployments and layered deployments.
Devices and modules have similar data, like connectivity, so you get values based on the device ID or module ID.
The IoT Hub service collects data reported by device and module twins and gives you counts of the different states that devices can have. The IoT Hub service organizes this data into four groups of metrics:
Type | Description |
---|---|
Targeted | Shows IoT Edge devices that match the deployment targeting condition. |
Applied | Shows targeted IoT Edge devices that aren't targeted by another deployment with higher priority. |
Reporting Success | Shows IoT Edge devices that report the modules are deployed successfully. |
Reporting Failure | Shows IoT Edge devices that report one or more modules aren't deployed successfully. To investigate the error, connect remotely to those devices and view the log files. |
You can monitor this data in the Azure portal or use Azure CLI.
Monitor a deployment in the Azure portal
To view deployment details and monitor the devices running it, follow these steps:
Sign in to the Azure portal, then go to your IoT Hub.
Select Configurations + Deployments under Device management.
Review the deployment list. For each deployment, you see the following details:
Column Description ID The name of the deployment. Type The type of deployment, either Deployment or Layered Deployment. Target Condition The tag that defines targeted devices. Priority The priority number assigned to the deployment. System metrics The number of device twins in IoT Hub that match the targeting condition. Applied shows the number of devices that have the deployment content applied to their module twins in IoT Hub. Device Metrics The number of IoT Edge devices reporting success or errors from the IoT Edge client runtime. Custom Metrics The number of IoT Edge devices reporting data for any metrics that you define for the deployment. Created The timestamp when the deployment is created. This timestamp is used to break ties when two deployments have the same priority. Select the deployment you want to monitor.
On the Deployment Details page, go to the Target Condition tab. Select View to list the devices that match the target condition. Change the condition or Priority as needed, then select Save.
Select the Metrics tab. When you choose a metric from the Select Metric drop-down, the View button appears so you can display the results. Select Edit Metrics to adjust the criteria for any custom metrics you define. Select Save if you make changes.
To change your deployment, see Modify a deployment.
Monitor a deployment with Azure CLI
Use the az iot edge deployment show command to show the details of a single deployment:
az iot edge deployment show --deployment-id [deployment id] --hub-name [hub name]
The deployment show
command uses these parameters:
- --deployment-id - The name of the deployment in the IoT hub. Required parameter.
- --hub-name - The name of the IoT hub where the deployment exists. The hub must be in the current subscription. Switch to the subscription with
az account set -s [subscription name]
Check the deployment in the command window. The metrics
property lists a count for each metric that is evaluated by each hub:
- targetedCount - The number of device twins in IoT Hub that match the targeting condition.
- appliedCount - The number of devices that have the deployment content applied to their module twins in IoT Hub.
- reportedSuccessfulCount - The number of IoT Edge devices in the deployment reporting success from the IoT Edge client runtime.
- reportedFailedCount - The number of IoT Edge devices in the deployment reporting failure from the IoT Edge client runtime.
Show a list of device IDs or objects for each metric with the az iot edge deployment show-metric command:
az iot edge deployment show-metric --deployment-id [deployment id] --metric-id [metric id] --hub-name [hub name]
The deployment show-metric
command uses these parameters:
- --deployment-id - The name of the deployment in the IoT hub.
- --metric-id - The name of the metric to show the list of device IDs, for example
reportedFailedCount
. - --hub-name - The name of the IoT hub where the deployment exists. The hub must be in the current subscription. Switch to the subscription with
az account set -s [subscription name]
. To make changes to your deployment, see Modify a deployment.
Next steps
Learn how to monitor module twins, primarily the IoT Edge Agent and IoT Edge Hub runtime modules, to check the connectivity and health of your IoT Edge deployments.