Troubleshoot MQTT data source issues
This document provides solutions to common issues you may encounter when configuring or using the MQTT data source. For configuration instructions, refer to Configure the MQTT data source.
Connection errors
These errors occur when Grafana can’t connect to the MQTT broker.
“MQTT Disconnected” on Save & test
Symptoms:
- Clicking Save & test displays MQTT Disconnected.
- Panels show no data.
Possible causes and solutions:
Connection drops or intermittent disconnections
Symptoms:
- Panels stop updating and then resume after a delay.
- Grafana logs show “MQTT Connection lost” warnings.
Solutions:
- Check the MQTT broker logs for client evictions or connection limits.
- Ensure only one Grafana instance uses each Client ID. If multiple instances share a Client ID, the broker disconnects the older connection.
- Verify network stability between the Grafana server and the broker.
- The plugin automatically reconnects after a disconnection with a maximum interval of 10 seconds.
Authentication errors
These errors occur when credentials or TLS certificates are invalid.
“error connecting to MQTT broker” with credentials
Symptoms:
- Save & test fails with an error mentioning connection failure.
- Broker logs show authentication rejections.
Possible causes and solutions:
TLS certificate errors
Symptoms:
- Connection fails when using
tls://scheme. - Error messages mention certificate verification, handshake failure, or key mismatch.
Possible causes and solutions:
Caution
Enabling Skip TLS Verification disables certificate chain and hostname verification. Use this only for testing, not in production environments.
Query errors
These errors occur when subscribing to topics or processing messages.
No data in panels
Symptoms:
- The panel shows “No data” despite the data source being connected.
- The connection test shows MQTT Connected but panels are empty.
Possible causes and solutions:
Unexpected field types or missing fields
Symptoms:
- Numeric values appear as strings.
- JSON object keys are missing from the data frame.
Solutions:
- Ensure numeric values are published without quotes (for example,
23.5not"23.5"). - For JSON payloads, only top-level keys are extracted into separate fields. Nested objects appear as JSON-typed fields. Use the Extract fields transformation to access nested values.
- If the first message defines a field as one type and a later message sends a different type for the same key, the later value is dropped. Ensure consistent data types across messages.
Performance issues
These issues relate to high message volumes or resource usage.
High CPU or memory usage
Symptoms:
- Grafana uses excessive resources when many MQTT topics are active.
- Dashboard panels lag or become unresponsive.
Solutions:
- Reduce the number of subscribed topics per dashboard.
- Increase the query interval to reduce the frequency of data frame generation. A longer interval buffers more messages per push but reduces processing overhead.
- Avoid subscribing to broad wildcard topics (such as
#) that match large numbers of subtopics. - Close dashboards and panels you aren’t actively using, since each open panel maintains an active subscription.
Enable debug logging
To capture detailed error information for troubleshooting:
Set the Grafana log level to
debugin the configuration file:[log] level = debugRestart Grafana for the change to take effect.
Review logs in
/var/log/grafana/grafana.log(or your configured log location).Look for entries with “MQTT” that include connection, subscription, and message details.
Reset the log level to
infoafter troubleshooting to avoid excessive log volume.
Get additional help
If you’ve tried the solutions in this document and still encounter issues:
- Check the Grafana community forums for similar issues and discussions.
- Review the MQTT datasource GitHub issues for known bugs and feature requests.
- Consult the MQTT v3.1.1 specification for protocol-level guidance.
- Contact Grafana Support if you’re a Cloud Pro, Cloud Advanced, or Enterprise customer.
- When reporting issues, include:
- Grafana version and plugin version
- Error messages (redact credentials and sensitive information)
- Steps to reproduce the issue
- Relevant broker configuration (redact credentials)



