Skip to content

Commit a7f9dc1

Browse files
committed
Metadata and formatting
1 parent eb99770 commit a7f9dc1

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

articles/iot-hub/iot-hub-distributed-tracing.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
---
2-
title: Add correlation IDs to IoT messages with distributed tracing (preview)
2+
title: Monitor IoT messages with distributed tracing (preview)
3+
titleSuffix: Azure IoT Hub
34
description: Learn how to use distributed tracing to trace IoT messages throughout the Azure services that your solution uses.
45
author: kgremban
56

67
ms.author: kgremban
78
ms.service: iot-hub
89
ms.topic: how-to
9-
ms.date: 01/26/2022
10-
ms.custom: [amqp, mqtt, fasttrack-edit, iot]
10+
ms.date: 02/29/2024
11+
ms.custom: [amqp, mqtt, fasttrack-edit, references_regions]
1112
---
1213

1314
# Trace Azure IoT device-to-cloud messages by using distributed tracing (preview)
1415

15-
IoT Hub is one of the first Azure services to support distributed tracing. As more Azure services support distributed tracing, you're able to trace Internet of Things (IoT) messages throughout the Azure services involved in your solution. For a background on the feature, see [What is distributed tracing?](../azure-monitor/app/distributed-tracing-telemetry-correlation.md).
16+
Use distributed tracing (preview) in IoT Hub to monitor IoT messages as they pass through Azure services. IoT Hub is one of the first Azure services to support distributed tracing. As more Azure services support distributed tracing, you're able to trace Internet of Things (IoT) messages throughout the Azure services involved in your solution. For more information about the feature, see [What is distributed tracing?](../azure-monitor/app/distributed-trace-data.md).
1617

1718
When you enable distributed tracing for IoT Hub, you can:
1819

@@ -126,44 +127,38 @@ You can use the Azure portal or the Azure IoT Hub extension for Visual Studio Co
126127
1. Select the gear icon under **Distributed Tracing (preview)**. In the panel that opens:
127128

128129
1. Select the **Enable** option.
129-
1. For **Sampling rate**, choose a percentage between 0 and 100.
130+
1. For **Sampling rate**, choose a percentage between 0 and 100.
130131
1. Select **Save**.
131132

132133
:::image type="content" source="media/iot-hub-distributed-tracing/enable-distributed-tracing.png" alt-text="Screenshot that shows how to enable distributed tracing in the Azure portal." lightbox="media/iot-hub-distributed-tracing/enable-distributed-tracing.png":::
133134

134135
1. Wait a few seconds, and then select **Refresh**. If the device successfully acknowledges your changes, a sync icon with a check mark appears.
135136

136-
1. Go back to the console window for the telemetry message app. Confirm that messages are being sent with `tracestate` in the application properties.
137-
138-
:::image type="content" source="media/iot-hub-distributed-tracing/MicrosoftTeams-image.png" alt-text="Screenshot that shows trace state messages." lightbox="media/iot-hub-distributed-tracing/MicrosoftTeams-image.png":::
139-
140-
1. (Optional) Change the sampling rate to a different value, and observe the change in frequency that messages include `tracestate` in the application properties.
141-
142137
#### [VS Code](#tab/vscode)
143138

144139
1. With Visual Studio Code installed, install the latest version of the [Azure IoT Hub extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-toolkit).
145140

146-
1. Open Visual Studio Code, and go to the **Explorer** tab and the **Azure IoT Hub** section.
141+
1. Open Visual Studio Code, and go to the **Explorer** tab and the **Azure IoT Hub** section.
147142

148-
1. Select the ellipsis (...) next to **Azure IoT Hub** to see a submenu. Choose the **Select IoT Hub** option to retrieve your IoT hub from Azure.
143+
1. Select the ellipsis (...) next to **Azure IoT Hub** to see a submenu. Choose the **Select IoT Hub** option to retrieve your IoT hub from Azure.
149144

150145
In the pop-up window that appears at the top of Visual Studio Code, you can select your subscription and IoT hub.
151146

152147
See a demonstration on the [vscode-azure-iot-toolkit](https://github.com/Microsoft/vscode-azure-iot-toolkit/wiki/Select-IoT-Hub) GitHub page.
153148

154-
1. Expand your device under **Devices**. Right-click **Distributed Tracing Setting (Preview)**, and then select **Update Distributed Tracing Setting (Preview)**.
149+
1. Expand your device under **Devices**. Right-click **Distributed Tracing Setting (Preview)**, and then select **Update Distributed Tracing Setting (Preview)**.
155150

156-
1. In the pop-up pane that appears at the top of the window, select **Enable**.
151+
1. In the pop-up pane that appears at the top of the window, select **Enable**.
157152

158153
:::image type="content" source="media/iot-hub-distributed-tracing/enable-distributed-tracing-vsc.png" alt-text="Screenshot that shows how to enable distributed tracing in the Azure IoT Hub extension.":::
159154

160155
**Enable Distributed Tracing: Enabled** now appears under **Distributed Tracing Setting (Preview)** > **Desired**.
161156

162-
1. In the pop-up pane that appears for the sampling rate, enter **100** and then select the Enter key.
157+
1. In the pop-up pane that appears for the sampling rate, enter an integer between 0 and 100, then select the Enter key.
163158

164159
![Screenshot that shows entering a sampling rate](./media/iot-hub-distributed-tracing/update-distributed-tracing-setting-3.png)
165160

166-
**Sample rate: 100(%)** now also appears under **Distributed Tracing Setting (Preview)** > **Desired**.
161+
**Sample rate: 100(%)** now appears under **Distributed Tracing Setting (Preview)** > **Desired**.
167162

168163
---
169164

@@ -300,7 +295,7 @@ In this section, you edit the [iothub_ll_telemetry_sample.c](https://github.com/
300295

301296
1. Keep the app running. You can observe the messages being sent to IoT Hub in the console window.
302297

303-
For a client app that can receive sampling decisions from the cloud, try the [iothub_devicetwin_sample.c](https://aka.ms/iottracingCsample) sample in the distributed tracing sample repo.
298+
For a client app that can receive sampling decisions from the cloud, try the [iothub_devicetwin_sample.c](https://github.com/Azure-Samples/azure-iot-distributed-tracing-sample/tree/master/iothub_devicetwin_sample-c) sample in the distributed tracing sample repo.
304299

305300
### Workaround for non-Microsoft clients
306301

0 commit comments

Comments
 (0)