Skip to content

Commit 6418e47

Browse files
committed
Freshness review
1 parent 7c93b4c commit 6418e47

File tree

2 files changed

+41
-37
lines changed

2 files changed

+41
-37
lines changed

articles/iot-edge/how-to-access-built-in-metrics.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: Access built-in metrics in Azure IoT Edge
3-
description: Remote access to built-in metrics from the IoT Edge runtime components
3+
description: Access built-in metrics from IoT Edge runtime components to monitor device health.
4+
#customer intent: As a system administrator, I want to access built-in metrics in Azure IoT Edge so that I can monitor and understand the health of my IoT Edge devices.
45
author: PatAltimore
5-
66
ms.author: patricka
7-
ms.date: 04/08/2024
8-
ms.topic: conceptual
7+
ms.date: 05/08/2025
8+
ms.topic: concept-article
99
ms.reviewer: veyalla
1010
ms.service: azure-iot-edge
1111
services: iot-edge
@@ -17,11 +17,11 @@ services: iot-edge
1717

1818
The IoT Edge runtime components, IoT Edge hub, and IoT Edge agent, produce built-in metrics in the [Prometheus exposition format](https://prometheus.io/docs/instrumenting/exposition_formats/). Access these metrics remotely to monitor and understand the health of an IoT Edge device.
1919

20-
You can use your own solution to access these metrics. Or, you can use the [metrics-collector module](https://mcr.microsoft.com/artifact/mar/azureiotedge-metrics-collector), which handles collecting the built-in metrics and sending them to Azure Monitor or Azure IoT Hub. For more information, see [Collect and transport metrics](how-to-collect-and-transport-metrics.md).
20+
Use your own solution to access these metrics, or use the [metrics-collector module](https://mcr.microsoft.com/artifact/mar/azureiotedge-metrics-collector), which collects the built-in metrics and sends them to Azure Monitor or Azure IoT Hub. For more information, see [Collect and transport metrics](how-to-collect-and-transport-metrics.md).
2121

22-
Metrics are automatically exposed by default on **port 9600** of the **edgeHub** and **edgeAgent** modules (`http://edgeHub:9600/metrics` and `http://edgeAgent:9600/metrics`). They aren't port mapped to the host by default.
22+
Metrics are exposed by default on **port 9600** of the **edgeHub** and **edgeAgent** modules (`http://edgeHub:9600/metrics` and `http://edgeAgent:9600/metrics`). They aren't mapped to the host by default.
2323

24-
Access metrics from the host by exposing and mapping the metrics port from the module's `createOptions`. The example below maps the default metrics port to port 9601 on the host:
24+
Access metrics from the host by exposing and mapping the metrics port in the module's `createOptions`. The following example maps the default metrics port to port 9601 on the host:
2525

2626
```json
2727
{
@@ -40,36 +40,36 @@ Access metrics from the host by exposing and mapping the metrics port from the m
4040
}
4141
```
4242

43-
Choose different and unique host port numbers if you are mapping both the edgeHub and edgeAgent's metrics endpoints.
43+
Choose different and unique host port numbers when mapping both the edgeHub and edgeAgent metrics endpoints.
4444

4545
> [!NOTE]
46-
> The environment variable `httpSettings__enabled` should not be set to `false` for built-in metrics to be available for collection.
46+
> The environment variable `httpSettings__enabled` must not be set to `false` for built-in metrics to be available for collection.
4747
>
4848
> Environment variables that can be used to disable metrics are listed in the [azure/iotedge repo doc](https://github.com/Azure/iotedge/blob/main/doc/EnvironmentVariables.md).
4949
5050
## Available metrics
5151

52-
Metrics contain tags to help identify the nature of the metric being collected. All metrics contain the following tags:
52+
Metrics include tags that identify the nature of the metric being collected. All metrics include the following tags:
5353

5454
| Tag | Description |
5555
|-|-|
56-
| iothub | The hub the device is talking to |
56+
| iothub | The hub the device communicates with |
5757
| edge_device | The ID of the current device |
5858
| instance_number | A GUID representing the current runtime. On restart, all metrics are reset. This GUID makes it easier to reconcile restarts. |
5959

60-
In the Prometheus exposition format, there are four core metric types: counter, gauge, histogram, and summary. For more information about the different metric types, see the [Prometheus metric types documentation](https://prometheus.io/docs/concepts/metric_types/).
60+
The Prometheus exposition format includes four core metric types: counter, gauge, histogram, and summary. For more information about the different metric types, see the [Prometheus metric types documentation](https://prometheus.io/docs/concepts/metric_types/).
6161

62-
The quantiles provided for the built-in histogram and summary metrics are 0.1, 0.5, 0.9 and 0.99.
62+
The quantiles for the built-in histogram and summary metrics are 0.1, 0.5, 0.9, and 0.99.
6363

64-
The **edgeHub** module produces the following metrics:
64+
The **edgeHub** module generates the following metrics:
6565

6666
| Name | Dimensions | Description |
6767
|-|-|-|
6868
| `edgehub_gettwin_total` | `source` (operation source)<br> `id` (module ID) | Type: counter<br> Total number of GetTwin calls |
6969
| `edgehub_messages_received_total` | `route_output` (output that sent message)<br> `id` | Type: counter<br> Total number of messages received from clients |
7070
| `edgehub_messages_sent_total` | `from` (message source)<br> `to` (message destination)<br>`from_route_output`<br> `to_route_input` (message destination input)<br> `priority` (message priority to destination) | Type: counter<br> Total number of messages sent to clients or upstream<br> `to_route_input` is empty when `to` is $upstream |
7171
| `edgehub_reported_properties_total` | `target`(update target)<br> `id` | Type: counter<br> Total reported property updates calls |
72-
| `edgehub_message_size_bytes` | `id`<br> | Type: summary<br> Message size from clients<br> Values may be reported as `NaN` if no new measurements are reported for a certain period of time (currently 10 minutes); for `summary` type, corresponding `_count` and `_sum` counters are emitted. |
72+
| `edgehub_message_size_bytes` | `id`<br> | Type: summary<br> Message size from clients<br> Values might be reported as `NaN` if no new measurements are reported for 10 minutes. For the `summary` type, corresponding `_count` and `_sum` counters are emitted. |
7373
| `edgehub_gettwin_duration_seconds` | `source` <br> `id` | Type: summary<br> Time taken for get twin operations |
7474
| `edgehub_message_send_duration_seconds` | `from`<br> `to`<br> `from_route_output`<br> `to_route_input` | Type: summary<br> Time taken to send a message |
7575
| `edgehub_message_process_duration_seconds` | `from` <br> `to` <br> `priority` | Type: summary<br> Time taken to process a message from the queue |
@@ -84,7 +84,7 @@ The **edgeHub** module produces the following metrics:
8484
| `edgehub_operation_retry_total` | `id`<br> `operation` (operation name) | Type: counter<br> Total number of times edgeHub operations were retried |
8585
| `edgehub_client_connect_failed_total` | `id` <br> `reason` (not authenticated)<br> | Type: counter<br> Total number of times clients failed to connect to edgeHub |
8686

87-
The **edgeAgent** module produces the following metrics:
87+
The **edgeAgent** module generates the following metrics:
8888

8989
| Name | Dimensions | Description |
9090
|-|-|-|
@@ -109,7 +109,7 @@ The **edgeAgent** module produces the following metrics:
109109
| `edgeAgent_total_network_out_bytes` | `module_name` | Type: gauge<br> The number of bytes sent to network |
110110
| `edgeAgent_total_disk_read_bytes` | `module_name` | Type: gauge<br> The number of bytes read from the disk |
111111
| `edgeAgent_total_disk_write_bytes` | `module_name` | Type: gauge<br> The number of bytes written to disk |
112-
| `edgeAgent_metadata` | `edge_agent_version`, `experimental_features`, `host_information` | Type: gauge<br> General metadata about the device. The value is always 0, information is encoded in the tags. Note `experimental_features` and `host_information` are json objects. `host_information` looks like ```{"OperatingSystemType": "linux", "Architecture": "x86_64", "Version": "1.2.7", "Provisioning": {"Type": "dps.tpm", "DynamicReprovisioning": false, "AlwaysReprovisionOnStartup": false}, "ServerVersion": "20.10.11+azure-3", "KernelVersion": "5.11.0-1027-azure", "OperatingSystem": "Ubuntu 20.04.4 LTS", "NumCpus": 2, "Virtualized": "yes"}```. Note `ServerVersion` is the Docker version and `Version` is the IoT Edge security daemon version. |
112+
| `edgeAgent_metadata` | `edge_agent_version`, `experimental_features`, `host_information` | Type: gauge<br> General metadata about the device. The value is always 0, and information is encoded in the tags. Note that `experimental_features` and `host_information` are JSON objects. `host_information` looks like ```{"OperatingSystemType": "linux", "Architecture": "x86_64", "Version": "1.2.7", "Provisioning": {"Type": "dps.tpm", "DynamicReprovisioning": false, "AlwaysReprovisionOnStartup": false}, "ServerVersion": "20.10.11+azure-3", "KernelVersion": "5.11.0-1027-azure", "OperatingSystem": "Ubuntu 20.04.4 LTS", "NumCpus": 2, "Virtualized": "yes"}```. Note `ServerVersion` is the Docker version and `Version` is the IoT Edge security daemon version. |
113113

114114
## Next steps
115115

articles/iot-edge/how-to-edgeagent-direct-method.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,54 @@
11
---
2-
title: Built-in edgeAgent direct methods - Azure IoT Edge
3-
description: Monitor and manage an IoT Edge deployment using built-in direct methods in the IoT Edge agent runtime module
2+
title: Communicate with IoT Edge Agent Using Direct Methods
3+
description: Discover how to use IoT Edge agent direct methods to monitor device status, restart modules, and troubleshoot deployments remotely.
44
author: PatAltimore
5-
65
ms.author: patricka
7-
ms.date: 03/02/2020
8-
ms.topic: conceptual
6+
ms.date: 05/08/2025
7+
ms.topic: concept-article
98
ms.reviewer: veyalla
109
ms.service: azure-iot-edge
1110
services: iot-edge
11+
ms.custom:
12+
- ai-gen-docs-bap
13+
- ai-gen-title
14+
- ai-seo-date:05/08/2025
15+
- ai-gen-description
1216
---
1317

1418
# Communicate with edgeAgent using built-in direct methods
1519

1620
[!INCLUDE [iot-edge-version-all-supported](includes/iot-edge-version-all-supported.md)]
1721

18-
Monitor and manage IoT Edge deployments by using the direct methods included in the IoT Edge agent module. Direct methods are implemented on the device, and then can be invoked from the cloud. The IoT Edge agent includes direct methods that help you monitor and manage your IoT Edge devices remotely.
22+
Monitor and manage IoT Edge deployments using the direct methods in the IoT Edge agent module. Direct methods are implemented on the device and can be invoked from the cloud. The IoT Edge agent includes direct methods to monitor and manage IoT Edge devices remotely.
1923

2024
For more information about direct methods, how to use them, and how to implement them in your own modules, see [Understand and invoke direct methods from IoT Hub](../iot-hub/iot-hub-devguide-direct-methods.md).
2125

22-
The names of these direct methods are handled case-insensitive.
26+
The names of these direct methods are case insensitive.
2327

2428
## Ping
2529

26-
The **ping** method is useful for checking whether IoT Edge is running on a device, or whether the device has an open connection to IoT Hub. Use this direct method to ping the IoT Edge agent and get its status. A successful ping returns an empty payload and **"status": 200**.
30+
The **ping** method checks if IoT Edge is running on a device or if the device has an open connection to IoT Hub. Use this method to ping the IoT Edge agent and check its status. A successful ping returns an empty payload and a **"status": 200**.
2731

2832
For example:
2933

3034
```azurecli
3135
az iot hub invoke-module-method --method-name 'ping' -n <hub name> -d <device name> -m '$edgeAgent'
3236
```
3337

34-
In the Azure portal, invoke the method with the method name `ping` and an empty JSON payload `{}`.
38+
In the Azure portal, invoke the method using the method name `ping` and an empty JSON payload `{}`.
3539

36-
:::image type="content" source="./media/how-to-edgeagent-direct-method/ping-direct-method.png" alt-text="Screenshot showing how to invoke the direct method ping in Azure portal.":::
40+
:::image type="content" source="./media/how-to-edgeagent-direct-method/ping-direct-method.png" alt-text="Screenshot of how to invoke the direct method ping in Azure portal.":::
3741

3842
## Restart module
3943

40-
The **RestartModule** method allows for remote management of modules running on an IoT Edge device. If a module is reporting a failed state or other unhealthy behavior, you can trigger the IoT Edge agent to restart it. A successful restart command returns an empty payload and **"status": 200**.
44+
The **RestartModule** method lets you remotely manage modules running on an IoT Edge device. If a module reports a failed state or unhealthy behavior, trigger the IoT Edge agent to restart it. A successful restart command returns an empty payload with **"status": 200**.
4145

42-
The RestartModule method is available in IoT Edge version 1.0.9 and later.
46+
The RestartModule method is available starting with IoT Edge version 1.0.9.
4347

4448
>[!TIP]
45-
>The IoT Edge troubleshooting page in the Azure portal provides a simplified experience for restarting modules. For more information, see [Monitor and troubleshoot IoT Edge devices from the Azure portal](troubleshoot-in-portal.md).
49+
>The IoT Edge troubleshooting page in the Azure portal simplifies restarting modules. For more information, see [Monitor and troubleshoot IoT Edge devices from the Azure portal](troubleshoot-in-portal.md).
4650
47-
You can use the RestartModule direct method on any module running on an IoT Edge device, including the edgeAgent module itself. However, if you use this direct method to shut down the edgeAgent, you won't receive a success result since the connection is disrupted while the module restarts.
51+
Use the RestartModule direct method on any module running on an IoT Edge device, including the edgeAgent module. If you use this direct method to shut down the edgeAgent, you don't receive a success result because the connection is disrupted during the module restart.
4852

4953
For example:
5054

@@ -58,7 +62,7 @@ az iot hub invoke-module-method --method-name 'RestartModule' -n <hub name> -d <
5862
'
5963
```
6064

61-
In the Azure portal, invoke the method with the method name `RestartModule` and the following JSON payload:
65+
In the Azure portal, use the method name `RestartModule` with the following JSON payload:
6266

6367
```json
6468
{
@@ -67,14 +71,14 @@ In the Azure portal, invoke the method with the method name `RestartModule` and
6771
}
6872
```
6973

70-
:::image type="content" source="./media/how-to-edgeagent-direct-method/restartmodule-direct-method.png" alt-text="Screenshot showing how to invoke direct method RestartModule in the Azure portal.":::
74+
:::image type="content" source="./media/how-to-edgeagent-direct-method/restartmodule-direct-method.png" alt-text="Screenshot of invoking the direct method RestartModule in the Azure portal.":::
7175

7276
## Diagnostic direct methods
7377

74-
* [GetModuleLogs](how-to-retrieve-iot-edge-logs.md#retrieve-module-logs): Retrieve module logs inline in the response of the direct method.
75-
* [UploadModuleLogs](how-to-retrieve-iot-edge-logs.md#upload-module-logs): Retrieve module logs and upload them to Azure Blob Storage.
76-
* [UploadSupportBundle](how-to-retrieve-iot-edge-logs.md#upload-support-bundle-diagnostics): Retrieve module logs using a support bundle and upload a zip file to Azure Blob Storage.
77-
* [GetTaskStatus](how-to-retrieve-iot-edge-logs.md#get-upload-request-status): Check on the status of an upload logs or support bundle request.
78+
* [GetModuleLogs](how-to-retrieve-iot-edge-logs.md#retrieve-module-logs): Retrieve module logs in the response of the direct method.
79+
* [UploadModuleLogs](how-to-retrieve-iot-edge-logs.md#upload-module-logs): Retrieve module logs and upload to Azure Blob Storage.
80+
* [UploadSupportBundle](how-to-retrieve-iot-edge-logs.md#upload-support-bundle-diagnostics): Retrieve module logs with a support bundle and upload a zip file to Azure Blob Storage.
81+
* [GetTaskStatus](how-to-retrieve-iot-edge-logs.md#get-upload-request-status): Check the status of an upload logs or support bundle request.
7882

7983
These diagnostic direct methods are available as of the 1.0.10 release.
8084

0 commit comments

Comments
 (0)