sapcc / mosquitto-exporter

Prometheus metrics exporter for the Mosquitto message broker
Apache License 2.0
128 stars 60 forks source link

Just wondering if anyone has a grafana dashboard using these exported metrics? #21

Closed brokenjacobs closed 2 years ago

brokenjacobs commented 4 years ago

If not, whenever I get one together I'll tack it onto this issue. It would be handy.

mnezerka commented 4 years ago

Yes, I use your exporter to feed my Prometheus which serves data to Grafana dashboard. .

tg44 commented 4 years ago

Would love one :D

tg44 commented 4 years ago

I uploaded one: https://grafana.com/grafana/dashboards/11542

ngosang commented 2 years ago

@tg44 thank you. I just made minor improvements in your dashboard.

mosquitto_dashboard.txt

image

reefland commented 2 years ago

@tg44 / @ngosang - Added a bit more...

image

mosquitto_dashboard.txt

brokenjacobs commented 2 years ago

Awesome thank you for sharing! Closing this issue.

Strykar commented 1 year ago

mosquitto_dashboard.txt

@reefland Thanks for this, but my dashboard does not show received data or correct client numbers, how do I troubleshoot this? image

reefland commented 1 year ago

Within the Prometheus GUI, you can make queries of the data directly. Such as:

Total Clients: broker_clients_total and click [Execute]. That should return the value scraped from mosquitto-exporter:

image

Same for broker_messages_received: image

You can also query the source directly using curl. Figure out which node it is running on:

$ kubectl get pods -n mosquitto -owide | grep exporter
mosquitto-exporter-58cf56c8b5-gpjss   1/1     Running   0          6d7h   10.42.3.44   k3s04   <none>           <none>

For me that is node k3s04, and above provided the pod IP address 10.42.3.44. So I SSH to that node and query directly:

$ curl -s http://10.42.3.44:9234/metrics | grep clients_total

# HELP broker_clients_total $SYS/broker/clients/total
# TYPE broker_clients_total counter
broker_clients_total 9

That shows you the path within the broker and the value.

Lastly, you can login using a client like MQTT Explorer to see what the values are within the broker.

Strykar commented 1 year ago

@reefland Thank you for the pointers, but something is off. The mosquitto_exporter does not see clients_total but logging in with the same credentials using mqtt-explorer shows the client count and messages received.

$ curl -s  http://127.0.0.1:9234/metrics | grep clients_total
$
$ curl -s  http://127.0.0.1:9234/metrics | grep broker_bytes_received
# HELP broker_bytes_received $SYS/broker/bytes/received
# TYPE broker_bytes_received counter
broker_bytes_received 17461

image

I've double checked the data source and it seems broker_subscription_count is not a metric from Prometheus on my instance: image