What is MQTT?
MQTT is a lightweight messaging protocol designed for devices with little bandwidth and limited processing power. Sensors, meters, PLC interfaces and IoT devices use it widely.
Devices do not connect to each other. The producer publishes a message to a broker, and whoever needs the data subscribes to the relevant topic.
- 1
A sensor (publisher) sends a message
- 2
The broker routes it by topic
- 3
The subscriber receives it
- 4
If the flow stops, the topic goes quiet
A device can look up while its topic is silent — the data flow may already have stopped.
Broker, topic and QoS
The broker is the centre every message passes through; if it stops, the flow stops. The topic decides under which name messages are distributed — a hierarchical name such as line1/temperature.
QoS is the delivery guarantee: 0 at most once, 1 at least once, 2 exactly once. Higher levels are safer and more costly.
- QoS 0: fast, for measurements where loss is acceptable
- QoS 1: may arrive twice, for data that must not be lost
- QoS 2: for critical commands where neither loss nor repeat is acceptable
The silent outage problem
MQTT's most treacherous field fault is that nothing raises an alarm. The broker is up, the device is up, the network is up — but no message has arrived on a topic for hours. In production that can mean a whole shift of measurements never recorded.
So 'is the device reachable' is not enough on its own. Whether the flow continues has to be monitored separately.
Setting up MQTT monitoring
A healthy setup has two layers: broker reachability, and continued message flow on the topics that matter. Read together, they separate a device problem from a broker problem quickly.
In Sentry, MQTT checks are defined in a monitoring template; the broker connection and the flow on selected topics are checked, and an incident opens when no message arrives within the expected window. Sending commands to devices or intervening in the production system is out of scope.
- Broker connection and authentication check
- Last-message time tracked on critical topics
- Incident opened and notification sent when the threshold is crossed
- Results read together with syslog records