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, logs, 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 current and past health and status of the MQTT broker. These metrics are emitted in OpenTelemetry format (OTLP). They can be converted to Prometheus format using an OpenTelemetry Collector and routed to Azure Managed Grafana Dashboards using Azure Monitor Managed Service for Prometheus. 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
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
+
To learn more, see [Configure observability and monitoring](../configure-observability-monitoring/howto-configure-observability.md).
32
+
33
+
## Self-check
34
+
35
+
The MQTT broker's self-check mechanism is enabled by default. It uses a diagnostics probe and OpenTelemetry (OTel) traces to monitor the broker. The probe sends test messages to check the system's behavior and timing.
36
+
37
+
The validation process checks if the system works correctly by comparing the test results with expected outcomes. These outcomes include:
38
+
39
+
1. The paths messages take through the system.
40
+
2. The system's timing behavior.
41
+
42
+
The diagnostics probe periodically executes MQTT operations (PING, CONNECT, PUBLISH, SUBSCRIBE, UNSUBSCRIBE) on the MQTT broker and monitors the corresponding ACKs and traces to check for latency, message loss, and correctness of the replication protocol.
43
+
44
+
> [!IMPORTANT]
45
+
> The self-check diagnostics 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).
46
+
47
+
## Change diagnostics settings
48
+
49
+
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
50
30
51
To override, first prepare a Broker config file following the [BrokerDiagnostics](/rest/api/iotoperations/broker/create-or-update#brokerdiagnostics) API reference. For example:
31
52
32
53
```json
33
54
{
34
55
"diagnostics": {
35
-
"logs": {
36
-
"level": "debug"
37
-
},
38
56
"metrics": {
39
57
"prometheusPort": 9600
40
58
},
41
-
"selfCheck": {
42
-
"mode": "Enabled",
43
-
"intervalSeconds": 30,
44
-
"timeoutSeconds": 15
45
-
},
59
+
"logs": {
60
+
"level": "debug"
61
+
},
46
62
"traces": {
47
63
"mode": "Enabled",
48
64
"cacheSizeMegabytes": 16,
@@ -51,6 +67,11 @@ To override, first prepare a Broker config file following the [BrokerDiagnostics
51
67
"intervalSeconds": 30
52
68
},
53
69
"spanChannelCapacity": 1000
70
+
},
71
+
"selfCheck": {
72
+
"mode": "Enabled",
73
+
"intervalSeconds": 30,
74
+
"timeoutSeconds": 15
54
75
}
55
76
}
56
77
}
@@ -62,8 +83,6 @@ Then, deploy Azure IoT Operations using the `az iot ops create` command with the
62
83
az iot ops create ... --broker-config-file <FILE>.json
63
84
```
64
85
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
86
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).
Copy file name to clipboardExpand all lines: articles/iot-operations/manage-mqtt-broker/overview-broker.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -181,8 +181,9 @@ Customizing the default Broker resource isn't required for most setups. The sett
181
181
-[**Cardinality**](./howto-configure-availability-scale.md#configure-scaling-settings): Determines the broker's capacity to handle more connections and messages, and it enhances high availability if there are pod or node failures.
182
182
-[**Memory profile**](./howto-configure-availability-scale.md#configure-memory-profile): Sets the maximum memory usage of the broker and how to handle memory usage as the broker scales up.
183
183
-[**Disk-backed message buffer**](./howto-disk-backed-message-buffer.md): Configuration for buffering messages to disk as RAM fills up.
184
-
-[**Encryption of internal traffic**](./howto-encrypt-internal-traffic.md): Configuration for encrypting internal traffic between broker frontend and backend pods.
184
+
-[**Diagnostics settings**](./howto-broker-diagnostics.md): Configuration for diagnostic settings like log level and metrics endpoint.
185
185
-[**Advanced MQTT client options**](./howto-broker-mqtt-client-options.md): Configuration for advanced MQTT client options like session expiry, message expiry, and keep-alive settings.
186
+
-[**Encryption of internal traffic**](./howto-encrypt-internal-traffic.md): Configuration for encrypting internal traffic between broker frontend and backend pods.
186
187
187
188
Customizing the default broker must be done during initial deployment time using Azure CLI or Azure portal. A new deployment is required if different Broker configuration settings are needed.
0 commit comments