Skip to content

Publishes MQTT messages as annotations (events) to Grafana

Notifications You must be signed in to change notification settings

uhlig-it/mqtt-grafana-event-publisher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MQTT Grafana Event Publisher

Publishes MQTT messages as annotations (events) to Grafana.

Example

  1. Subscribe to home/frontdoor and home/backdoor at mqtt.example.com (authenticated as alice with the password s3cret).
  2. Publish each message received on one of these topics as Grafana annotation to grafana.example.com (authenticated as bob with the password geh3im). The message payload is prefixed with $topic: .
  3. Tag each annotation with mqtt and home.
$ mqtt-grafana-event-publisher \
    --mqtt-url mqtts://alice:[email protected] \
    --grafana-url https://bob:[email protected] \
    --verbose \
    --topic home/frontdoor \
    --topic home/backdoor \
    --tag mqtt \
    --tag home

As 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.

Development

$ find . -name '*.go' -type f | entr -r \
    go run cmd/mqtt-grafana-event-publisher \
      --verbose \
      --topic home/door \
      --tag mqtt \
      --tag home

About

Publishes MQTT messages as annotations (events) to Grafana

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages