Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

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:<VERSION> -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


The release is done automatically by goreleaser. To release a new version, just set a git tag. Goreleaser run by Github Actions will create the binaries and upload them to the according Github release.