Prometheus Exporter for MQTT monitoring
Switch branches/tags
Nothing to show
Clone or download
arnoldbechtoldt relese v0.3.0
Signed-off-by: Arnold Bechtoldt <>
Latest commit f834891 Sep 26, 2018

MQTT Blackbox Exporter

Build Status Go Report Card Docker Pulls

Tests MQTT messaging roundtrips (publish/subscribe on same topic).

Definition of roundtrip:

  • start subscriber on $topic
  • start publisher on $topic
  • publish $messages on $topic
  • receive $message on $topic


$ mkdir -p ${GOPATH}/src/
$ git clone ${GOPATH}/src/
$ cd ${GOPATH}/src/
$ make

This will build the mqtt_blackbox_exporter for all target platforms and write them to the build/ directory.

Binaries are provided on Github, see


Place the binary somewhere in a PATH directory and make it executable (chmod +x mqtt_blackbox_exporter).


See config.yaml.dist for a configuration example.



$ ./mqtt_blackbox_exporter -config.file config.yaml

Using Docker:

docker run --rm -it -p 9214:9214 -v ${PWD}/:/data/ inovex/mqtt_blackbox_exporter:latest -config.file /data/config.yaml
$ curl -s
# HELP probe_mqtt_completed_total Number of completed probes.
# TYPE probe_mqtt_completed_total counter
probe_mqtt_completed_total{broker="ssl://",name="mqtt broker SSL"} 64


# HELP probe_mqtt_duration_seconds Time taken to execute probe.
# TYPE probe_mqtt_duration_seconds histogram
probe_mqtt_duration_seconds_bucket{broker="ssl://",name="mqtt broker SSL",le="0.005"} 0
probe_mqtt_duration_seconds_bucket{broker="ssl://",name="mqtt broker SSL",le="0.01"} 0
probe_mqtt_duration_seconds_sum{broker="ssl://",name="mqtt broker SSL"} 50.09346619300002
probe_mqtt_duration_seconds_count{broker="ssl://",name="mqtt broker SSL"} 64

# HELP probe_mqtt_messages_published_total Number of published messages.
# TYPE probe_mqtt_messages_published_total counter
probe_mqtt_messages_published_total{broker="ssl://",name="mqtt broker SSL"} 640

# HELP probe_mqtt_messages_received_total Number of received messages.
# TYPE probe_mqtt_messages_received_total counter
probe_mqtt_messages_received_total{broker="ssl://",name="mqtt broker SSL"} 640

# HELP probe_mqtt_started_total Number of started probes.
# TYPE probe_mqtt_started_total counter
probe_mqtt_started_total{broker="ssl://",name="mqtt broker SSL"} 64