---
title: Azure IoT Edge
description: Monitor the health and performance of an Azure IoT Edge device and modules.
breadcrumbs: Docs > Integrations > Azure IoT Edge
---

# Azure IoT Edge
Supported OS Integration version6.5.0
## Overview{% #overview %}

[Azure IoT Edge](https://azure.microsoft.com/en-us/services/iot-edge/) is a fully managed service to deploy Cloud workloads to run on Internet of Things (IoT) Edge devices using standard containers.

Use the Datadog-Azure IoT Edge integration to collect metrics and health status from IoT Edge devices.

**Note**: This integration requires IoT Edge runtime version 1.0.10 or above.

**Minimum Agent version:** 7.24.0

## Setup{% #setup %}

Follow the instructions below to install and configure this check for an IoT Edge device running on a device host.

### Installation{% #installation %}

The Azure IoT Edge check is included in the [Datadog Agent](https://app.datadoghq.com/account/settings/agent/latest) package.

No additional installation is needed on your device.

### Configuration{% #configuration %}

Configure the IoT Edge device so that the Agent runs as a custom module. Follow the Microsoft documentation on [deploying Azure IoT Edge modules](https://docs.microsoft.com/en-us/azure/iot-edge/how-to-deploy-modules-portal) for information on installing and working with custom modules for Azure IoT Edge.

Follow the steps below to configure the IoT Edge device, runtime modules, and the Datadog Agent to start collecting IoT Edge metrics.

1. Configure the **Edge Agent** runtime module as follows:

   - Image version must be `1.0.10` or above.

   - Under "Create Options", add the following `Labels`. Edit the `com.datadoghq.ad.instances` label as appropriate. See the [sample azure_iot_edge.d/conf.yaml](https://github.com/DataDog/integrations-core/blob/master/azure_iot_edge/datadog_checks/azure_iot_edge/data/conf.yaml.example) for all available configuration options. See the documentation on [Docker Integrations Autodiscovery](https://docs.datadoghq.com/agent/docker/integrations.md) for more information on labels-based integration configuration.

     ```json
     "Labels": {
         "com.datadoghq.ad.check_names": "[\"azure_iot_edge\"]",
         "com.datadoghq.ad.init_configs": "[{}]",
         "com.datadoghq.ad.instances": "[{\"edge_hub_prometheus_url\": \"http://edgeHub:9600/metrics\", \"edge_agent_prometheus_url\": \"http://edgeAgent:9600/metrics\"}]"
     }
     ```

1. Configure the **Edge Hub** runtime module as follows:

   - Image version must be `1.0.10` or above.

1. Install and configure the Datadog Agent as a **custom module**:

   - Set the module name. For example: `datadog-agent`.

   - Set the Agent image URI. For example: `datadog/agent:7`.

   - Under "Environment Variables", configure your `DD_API_KEY`. You may also set extra Agent configuration here (see [Agent Environment Variables](https://docs.datadoghq.com/agent/guide/environment-variables.md)).

   - Under "Container Create Options", enter the following configuration based on your device OS. **Note**: `NetworkId` must correspond to the network name set in the device `config.yaml` file.

     - Linux:
       ```json
       {
           "HostConfig": {
               "NetworkMode": "default",
               "Env": ["NetworkId=azure-iot-edge"],
               "Binds": ["/var/run/docker.sock:/var/run/docker.sock"]
           }
       }
       ```
     - Windows:
       ```json
       {
           "HostConfig": {
               "NetworkMode": "default",
               "Env": ["NetworkId=nat"],
               "Binds": ["//./pipe/iotedge_moby_engine:/./pipe/docker_engine"]
           }
       }
       ```

   - Save the Datadog Agent custom module.

1. Save and deploy changes to your device configuration.

#### Log collection{% #log-collection %}

1. Collecting logs is disabled by default in the Datadog Agent, enable it by configuring your Datadog Agent custom module:

   - Under "Environment Variables", set the `DD_LOGS_ENABLED` environment variable:

     ```yaml
     DD_LOGS_ENABLED: true
     ```

1. Configure the **Edge Agent** and **Edge Hub** modules: under "Create Options", add the following label:

   ```json
   "Labels": {
       "com.datadoghq.ad.logs": "[{\"source\": \"azure.iot_edge\", \"service\": \"<SERVICE>\"}]",
       "...": "..."
   }
   ```

Change the `service` based on your environment.

Repeat this operation for any custom modules you'd like to collect logs for.

1. Save and deploy changes to your device configuration.

### Validation{% #validation %}

Once the Agent has been deployed to the device, [run the Agent's status subcommand](https://docs.datadoghq.com/agent/guide/agent-commands.md#agent-status-and-information) and look for `azure_iot_edge` under the Checks section.

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

|  |
|  |
| **azure.iot\_edge.edge\_agent.available\_disk\_space\_bytes**(gauge)                          | Amount of space left on the disk `disk_name.*Shown as byte*                                               |
| **azure.iot\_edge.edge\_agent.total\_disk\_write\_bytes**(count)                              | Total amount of bytes written to the disk by module `module_name`.*Shown as byte*                         |
| **azure.iot\_edge.edge\_agent.total\_memory\_bytes**(gauge)                                   | Total amount of RAM available to module `module_name`.*Shown as byte*                                     |
| **azure.iot\_edge.edge\_agent.total\_network\_in\_bytes**(count)                              | Total amount of bytes received from the network by module `module_name`.*Shown as byte*                   |
| **azure.iot\_edge.edge\_agent.total\_network\_out\_bytes**(count)                             | Total amount of bytes sent to the network by module `module_name`.*Shown as byte*                         |
| **azure.iot\_edge.edge\_agent.total\_time\_expected\_running\_seconds**(gauge)                | The amount of time the module `module_name` was specified in the deployment.                              |
| **azure.iot\_edge.edge\_agent.total\_time\_running\_correctly\_seconds**(gauge)               | The amount of time the module `module_name` was specified in the deployment and was in the running state. |
| **azure.iot\_edge.edge\_agent.unsuccessful\_iothub\_syncs\_total**(count)                     | Total number of times the Edge Agent failed to sync its twin with IoT Hub.                                |
| **azure.iot\_edge.edge\_agent.used\_cpu\_percent.count**(gauge)                               | Count of percent of CPU used by all processes in module `module_name`.                                    |
| **azure.iot\_edge.edge\_agent.used\_cpu\_percent.quantile**(gauge)                            | Quantile of percent of CPU used by all processes in module `module_name`.*Shown as percent*               |
| **azure.iot\_edge.edge\_agent.used\_cpu\_percent.sum**(gauge)                                 | Sum of percent of CPU used by all processes in module `module_name`.*Shown as percent*                    |
| **azure.iot\_edge.edge\_agent.used\_memory\_bytes**(gauge)                                    | Amount of RAM used by all processes in module `module_name`.*Shown as byte*                               |
| **azure.iot\_edge.edge\_hub.client\_connect\_failed\_total**(count)                           | Total number of times clients failed to connect to Edge Hub.                                              |
| **azure.iot\_edge.edge\_hub.direct\_method\_duration\_seconds.count**(gauge)                  | Count of time taken to resolve a direct message.                                                          |
| **azure.iot\_edge.edge\_hub.direct\_method\_duration\_seconds.quantile**(gauge)               | Quantile of time taken to resolve a direct message.*Shown as second*                                      |
| **azure.iot\_edge.edge\_hub.direct\_method\_duration\_seconds.sum**(gauge)                    | Sum of time taken to resolve a direct message.*Shown as second*                                           |
| **azure.iot\_edge.edge\_hub.direct\_methods\_total**(count)                                   | Total number of direct messages sent.                                                                     |
| **azure.iot\_edge.edge\_hub.gettwin\_duration\_seconds.count**(gauge)                         | Count of time taken for get twin operations.                                                              |
| **azure.iot\_edge.edge\_hub.gettwin\_duration\_seconds.quantile**(gauge)                      | Quantile of time taken for get twin operations.*Shown as second*                                          |
| **azure.iot\_edge.edge\_hub.gettwin\_duration\_seconds.sum**(gauge)                           | Sum of time taken for get twin operations.*Shown as second*                                               |
| **azure.iot\_edge.edge\_hub.gettwin\_total**(count)                                           | Total number of GetTwin calls.                                                                            |
| **azure.iot\_edge.edge\_hub.message\_process\_duration\_seconds.count**(gauge)                | Count of time taken to process a message from the queue.                                                  |
| **azure.iot\_edge.edge\_hub.message\_process\_duration\_seconds.quantile**(gauge)             | Quantile of time taken to process a message from the queue.*Shown as second*                              |
| **azure.iot\_edge.edge\_hub.message\_process\_duration\_seconds.sum**(gauge)                  | Sum of time taken to process a message from the queue.*Shown as second*                                   |
| **azure.iot\_edge.edge\_hub.message\_send\_duration\_seconds.count**(gauge)                   | Count of time taken to send a message.                                                                    |
| **azure.iot\_edge.edge\_hub.message\_send\_duration\_seconds.quantile**(gauge)                | Quantile of time taken to send a message.*Shown as second*                                                |
| **azure.iot\_edge.edge\_hub.message\_send\_duration\_seconds.sum**(gauge)                     | Sum of time taken to send a message.*Shown as second*                                                     |
| **azure.iot\_edge.edge\_hub.message\_size\_bytes.count**(gauge)                               | Count of message size from clients.                                                                       |
| **azure.iot\_edge.edge\_hub.message\_size\_bytes.quantile**(gauge)                            | Quantile of message size from clients.*Shown as byte*                                                     |
| **azure.iot\_edge.edge\_hub.message\_size\_bytes.sum**(gauge)                                 | Sum of message size from clients.*Shown as byte*                                                          |
| **azure.iot\_edge.edge\_hub.messages\_dropped\_total**(count)                                 | Total number of messages removed because of `reason`.                                                     |
| **azure.iot\_edge.edge\_hub.messages\_received\_total**(count)                                | Total number of messages received from clients.                                                           |
| **azure.iot\_edge.edge\_hub.messages\_sent\_total**(count)                                    | Total number of messages sent to clients of upstream.                                                     |
| **azure.iot\_edge.edge\_hub.messages\_unack\_total**(count)                                   | Total number of messages unack because of storage failure.                                                |
| **azure.iot\_edge.edge\_hub.offline\_count\_total**(count)                                    | Total number of times Edge Hub went offline.                                                              |
| **azure.iot\_edge.edge\_hub.offline\_duration\_seconds.count**(gauge)                         | Count of time Edge Hub was offline.                                                                       |
| **azure.iot\_edge.edge\_hub.offline\_duration\_seconds.quantile**(gauge)                      | Quantile of time Edge Hub was offline.*Shown as second*                                                   |
| **azure.iot\_edge.edge\_hub.offline\_duration\_seconds.sum**(gauge)                           | Sum of time Edge Hub was offline.*Shown as second*                                                        |
| **azure.iot\_edge.edge\_hub.operation\_retry\_total**(count)                                  | Total number of times Edge operations were retried.                                                       |
| **azure.iot\_edge.edge\_hub.queue\_length**(gauge)                                            | Current length of Edge Hub's queue for a given `priority`.                                                |
| **azure.iot\_edge.edge\_hub.reported\_properties\_total**(count)                              | Total reported property updates calls.                                                                    |
| **azure.iot\_edge.edge\_hub.reported\_properties\_update\_duration\_seconds.count**(gauge)    | Count of time taken to update reported properties.                                                        |
| **azure.iot\_edge.edge\_hub.reported\_properties\_update\_duration\_seconds.quantile**(gauge) | Quantile of time taken to update reported properties.*Shown as second*                                    |
| **azure.iot\_edge.edge\_hub.reported\_properties\_update\_duration\_seconds.sum**(gauge)      | Sum of time taken to update reported properties.*Shown as second*                                         |

### Events{% #events %}

Azure IoT Edge does not include any events.

### Service Checks{% #service-checks %}

**azure.iot\_edge.edge\_agent.prometheus.health**

Returns `CRITICAL` if the Agent is unable to reach the Edge Agent metrics Prometheus endpoint. Returns `OK` otherwise.

*Statuses: ok, critical*

**azure.iot\_edge.edge\_hub.prometheus.health**

Returns `CRITICAL` if the Agent is unable to reach the Edge Hub metrics Prometheus endpoint. Returns `OK` otherwise.

*Statuses: ok, critical*

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).

## Further Reading{% #further-reading %}

- [Monitor Azure IoT Edge with Datadog](https://www.datadoghq.com/blog/monitor-azure-iot-edge-with-datadog/)
