You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Learn how to configure diagnostics settings for the Azure IoT Operations MQTT broker, like logs, metrics, self-check, and tracing.
4
4
author: PatAltimore
5
5
ms.author: patricka
6
6
ms.topic: how-to
7
7
ms.service: azure-iot-operations
8
8
ms.subservice: azure-mqtt-broker
9
-
ms.date: 11/07/2024
9
+
ms.date: 11/14/2024
10
10
11
11
#CustomerIntent: As an operator, I want to configure diagnostics so that I can monitor MQTT broker communications.
12
12
---
13
13
14
-
# Configure MQTT broker diagnostic settings
14
+
# Configure MQTT broker diagnostics settings
15
15
16
16
> [!IMPORTANT]
17
17
> This setting requires modifying the Broker resource and can only be configured at initial deployment time using the Azure CLI or Azure Portal. A new deployment is required if Broker configuration changes are needed. To learn more, see [Customize default Broker](./overview-broker.md#customize-default-broker).
18
18
19
-
Diagnostic settings allow you to enable metricsand tracing for MQTT broker.
19
+
Diagnostic settings allow you to configure metrics, tracing, logging, and self-check for the MQTT broker.
20
20
21
-
- Logs provide information about the operations performed by MQTT broker.
22
-
- Metrics provide information about the resource utilization and throughput of MQTT broker.
23
-
- Self-check periodically checks the health of MQTT broker by running a set of diagnostic tests.
24
-
- Tracing provides detailed information about the requests and responses handled by MQTT broker.
21
+
## Metrics
25
22
26
-
## Change diagnostic settings
23
+
Metrics provide information about the resource utilization and throughput of MQTT broker. These metrics are available in Prometheus format and can be scraped by Prometheus or Azure Monitor through OpenTelemetry Collector. To learn more, see [Configure observability and monitoring](../configure-observability-monitoring/howto-configure-observability.md).
27
24
28
-
In most scenarios, the default diagnostic settings are sufficient. To override default diagnostic settings for MQTT broker, edit the `diagnostics` section in the Broker resource. Currently, changing settings is only supported using the `--broker-config-file` flag when you deploy the Azure IoT Operations using the `az iot ops create` command.
25
+
For the full list of metrics available, see [MQTT broker metrics](../reference/observability-metrics-mqtt-broker.md).
26
+
27
+
## Logs and traces
28
+
29
+
Logs provide information about the operations performed by MQTT broker. These logs are available in the Kubernetes cluster as container logs. They can be configured to be sent to Azure Monitor Logs with Container Insights.
30
+
31
+
Traces are for [distributed tracing](https://opentelemetry.io/docs/concepts/signals/traces/) and provide detailed information about the requests and responses handled by MQTT broker. These traces can be sent to Azure Monitor through OpenTelemetry Collector.
32
+
33
+
To learn more, see [Configure observability and monitoring](../configure-observability-monitoring/howto-configure-observability.md).
34
+
35
+
## Self-check
36
+
37
+
The self-check probe is a part of the MQTT broker and is enabled by default. It uses OpenTelemetry (OTel) events to monitor the system. The probe sends test messages to check the system's behavior and timing.
38
+
39
+
The validation process checks if the system works correctly by comparing the test results with expected outcomes. These outcomes include:
40
+
41
+
1. The paths messages take through the system.
42
+
2. The system's timing behavior.
43
+
44
+
The system uses MQTT for messaging, including the replication protocol. The probe generates test traffic for all MQTT operations (CONNECT, PUBLISH, SUBSCRIBE, PING) and monitors them to ensure they follow the correct paths.
45
+
46
+
> [!IMPORTANT]
47
+
> The self-check probe publishes messages to the `azedge/dmqtt/selftest` topic. Don't publish or subscribe to diagnostic probe topics that start with `azedge/dmqtt/selftest`. Publishing or subscribing to these topics might affect the probe or self-test checks resulting in invalid results. Invalid results might be listed in diagnostic probe logs, metrics, or dashboards. For example, you might see the issue *Path verification failed for probe event with operation type 'Publish'* in the diagnostics-probe logs. For more information, see [Known Issues](../troubleshoot/known-issues.md#mqtt-broker).
48
+
49
+
## Change diagnostics settings
50
+
51
+
In most scenarios, the default diagnostics settings are sufficient. To override default diagnostics settings for MQTT broker, edit the `diagnostics` section in the Broker resource. Currently, changing settings is only supported using the `--broker-config-file` flag when you deploy the Azure IoT Operations using the `az iot ops create` command.
29
52
30
53
To override, first prepare a Broker config file following the [BrokerDiagnostics](/rest/api/iotoperations/broker/create-or-update#brokerdiagnostics) API reference. For example:
31
54
32
55
```json
33
56
{
34
57
"diagnostics": {
35
-
"logs": {
36
-
"level": "debug"
37
-
},
38
58
"metrics": {
39
59
"prometheusPort": 9600
40
60
},
41
-
"selfCheck": {
42
-
"mode": "Enabled",
43
-
"intervalSeconds": 30,
44
-
"timeoutSeconds": 15
45
-
},
61
+
"logs": {
62
+
"level": "debug"
63
+
},
46
64
"traces": {
47
65
"mode": "Enabled",
48
66
"cacheSizeMegabytes": 16,
@@ -51,6 +69,11 @@ To override, first prepare a Broker config file following the [BrokerDiagnostics
51
69
"intervalSeconds": 30
52
70
},
53
71
"spanChannelCapacity": 1000
72
+
},
73
+
"selfCheck": {
74
+
"mode": "Enabled",
75
+
"intervalSeconds": 30,
76
+
"timeoutSeconds": 15
54
77
}
55
78
}
56
79
}
@@ -62,8 +85,6 @@ Then, deploy Azure IoT Operations using the `az iot ops create` command with the
62
85
az iot ops create ... --broker-config-file <FILE>.json
63
86
```
64
87
65
-
The self-test diagnostics probe publishes messages to the `azedge/dmqtt/selftest` topic. You shouldn't publish or subscribe to this topic as it's used for internal diagnostics. For more information, see [Known Issues](../troubleshoot/known-issues.md#mqtt-broker).
66
-
67
88
To learn more, see [Azure CLI support for advanced MQTT broker configuration](https://aka.ms/aziotops-broker-config) and [Broker examples](/rest/api/iotoperations/broker/create-or-update#examples).
0 commit comments