Publishes MQTT messages as annotations (events) to Grafana.
- Subscribe to
home/frontdoorandhome/backdooratmqtt.example.com(authenticated asalicewith the passwords3cret). - Publish each message received on one of these topics as Grafana annotation to
grafana.example.com(authenticated asbobwith the passwordgeh3im). The message payload is prefixed with$topic:. - Tag each annotation with
mqttandhome.
$ mqtt-grafana-event-publisher \
--mqtt-url mqtts://alice:s3cret@mqtt.example.com \
--grafana-url https://bob:geh3im@grafana.example.com \
--verbose \
--topic home/frontdoor \
--topic home/backdoor \
--tag mqtt \
--tag homeAs the URLs contain secrets, it is recommended to set them as environment variables MQTT_URL GRAFANA_URL instead of passing them as command line parameters.
$ find . -name '*.go' -type f | entr -r \
go run cmd/mqtt-grafana-event-publisher \
--verbose \
--topic home/door \
--tag mqtt \
--tag home