|
| 1 | +# Agent Check: Azure IoT Edge |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +[Azure IoT Edge][1] is a fully managed service to deploy Cloud workloads to run on Internet of Things (IoT) Edge devices via standard containers. |
| 6 | + |
| 7 | +Use the Datadog-Azure IoT Edge integration to collect metrics and health status from IoT Edge devices. |
| 8 | + |
| 9 | +**Note**: This integration requires IoT Edge runtime version 1.0.10 or above. |
| 10 | + |
| 11 | +## Setup |
| 12 | + |
| 13 | +Follow the instructions below to install and configure this check for an IoT Edge device running on a device host. |
| 14 | + |
| 15 | +### Installation |
| 16 | + |
| 17 | +The Azure IoT Edge check is included in the [Datadog Agent][2] package. |
| 18 | + |
| 19 | +No additional installation is needed on your device. |
| 20 | + |
| 21 | +### Configuration |
| 22 | + |
| 23 | +Configure the IoT Edge device so that the Agent runs as a custom module. Follow the Microsoft documentation on [deploying Azure IoT Edge modules][3] for information on installing and working with custom modules for Azure IoT Edge. |
| 24 | + |
| 25 | +Follow the steps below to configure the IoT Edge device, runtime modules, and the Datadog Agent to start collecting IoT Edge metrics. |
| 26 | + |
| 27 | +1. Configure the **Edge Agent** runtime module as follows: |
| 28 | + - Image version must be `1.0.10` or above. |
| 29 | + - 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][5] for all available configuration options. See the documentation on [Docker Integrations Autodiscovery][6] for more information on labels-based integration configuration. |
| 30 | + |
| 31 | + ```json |
| 32 | + "Labels": { |
| 33 | + "com.datadoghq.ad.check_names": "[\"azure_iot_edge\"]", |
| 34 | + "com.datadoghq.ad.init_configs": "[{}]", |
| 35 | + "com.datadoghq.ad.instances": "[{\"edge_hub_prometheus_url\": \"http://edgeHub:9600/metrics\", \"edge_agent_prometheus_url\": \"http://edgeAgent:9600/metrics\"}]" |
| 36 | + } |
| 37 | + ``` |
| 38 | + |
| 39 | + - Under "Environment Variables", enable experimental metrics by adding these environment variables (note the double underscores): |
| 40 | + - `ExperimentalFeatures__Enabled`: `true` |
| 41 | + - `ExperimentalFeatures__EnableMetrics`: `true` |
| 42 | + |
| 43 | +1. Configure the **Edge Hub** runtime module as follows: |
| 44 | + - Image version must be `1.0.10` or above. |
| 45 | + - Under "Environment Variables", enable experimental metrics by adding these environment variables (note the double underscores): |
| 46 | + - `ExperimentalFeatures__Enabled`: `true` |
| 47 | + - `ExperimentalFeatures__EnableMetrics`: `true` |
| 48 | + |
| 49 | +1. Install and configure the Datadog Agent as a **custom module**: |
| 50 | + - Set the module name. For example: `datadog-agent`. |
| 51 | + - Set the Agent image URI. For example: `datadog/agent:7`. |
| 52 | + - Under "Environment Variables", configure your `DD_API_KEY`. You may also set extra Agent configuration here (see [Agent Environment Variables][4]). |
| 53 | + - 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. |
| 54 | + |
| 55 | + - Linux: |
| 56 | + ```json |
| 57 | + { |
| 58 | + "HostConfig": { |
| 59 | + "NetworkMode": "default", |
| 60 | + "Env": ["NetworkId=azure-iot-edge"], |
| 61 | + "Binds": ["/var/run/docker.sock:/var/run/docker.sock"] |
| 62 | + } |
| 63 | + } |
| 64 | + ``` |
| 65 | + - Windows: |
| 66 | + ```json |
| 67 | + { |
| 68 | + "HostConfig": { |
| 69 | + "NetworkMode": "default", |
| 70 | + "Env": ["NetworkId=nat"], |
| 71 | + "Binds": ["//./pipe/iotedge_moby_engine:/./pipe/docker_engine"] |
| 72 | + } |
| 73 | + } |
| 74 | + ``` |
| 75 | + |
| 76 | + - Save the Datadog Agent custom module. |
| 77 | + |
| 78 | +1. Save and deploy changes to your device configuration. |
| 79 | + |
| 80 | +### Validation |
| 81 | + |
| 82 | +Once the Agent has been deployed to the device, [run the Agent's status subcommand][7] and look for `azure_iot_edge` under the Checks section. |
| 83 | + |
| 84 | +## Data Collected |
| 85 | + |
| 86 | +### Metrics |
| 87 | + |
| 88 | +See [metadata.csv][8] for a list of metrics provided by this check. |
| 89 | + |
| 90 | +### Service Checks |
| 91 | + |
| 92 | +**azure.iot_edge.edge_agent.prometheus.health**: |
| 93 | +Returns `CRITICAL` if the Agent is unable to reach the Edge Agent metrics Prometheus endpoint. Returns `OK` otherwise. |
| 94 | + |
| 95 | +**azure.iot_edge.edge_hub.prometheus.health**: |
| 96 | +Returns `CRITICAL` if the Agent is unable to reach the Edge Hub metrics Prometheus endpoint. Returns `OK` otherwise. |
| 97 | + |
| 98 | +### Events |
| 99 | + |
| 100 | +Azure IoT Edge does not include any events. |
| 101 | + |
| 102 | +## Troubleshooting |
| 103 | + |
| 104 | +Need help? Contact [Datadog support][9]. |
| 105 | + |
| 106 | +[1]: https://azure.microsoft.com/en-us/services/iot-edge/ |
| 107 | +[2]: https://docs.datadoghq.com/agent/ |
| 108 | +[3]: https://docs.microsoft.com/en-us/azure/iot-edge/how-to-deploy-modules-portal |
| 109 | +[4]: https://docs.datadoghq.com/agent/guide/environment-variables/ |
| 110 | +[5]: https://github.com/DataDog/integrations-core/blob/master/azure_iot_edge/datadog_checks/azure_iot_edge/data/conf.yaml.example |
| 111 | +[6]: https://docs.datadoghq.com/agent/docker/integrations/ |
| 112 | +[7]: https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information |
| 113 | +[8]: https://github.com/DataDog/integrations-core/blob/master/azure_iot_edge/metadata.csv |
| 114 | +[9]: https://docs.datadoghq.com/help/ |
0 commit comments