Closed brokenjacobs closed 2 years ago
Yes, I use your exporter to feed my Prometheus which serves data to Grafana dashboard. .
Would love one :D
I uploaded one: https://grafana.com/grafana/dashboards/11542
@tg44 thank you. I just made minor improvements in your dashboard.
@tg44 / @ngosang - Added a bit more...
Awesome thank you for sharing! Closing this issue.
@reefland Thanks for this, but my dashboard does not show received data or correct client numbers, how do I troubleshoot this?
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:
Same for broker_messages_received
:
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.
@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
I've double checked the data source and it seems broker_subscription_count is not a metric from Prometheus on my instance:
If not, whenever I get one together I'll tack it onto this issue. It would be handy.