Koenkk / zigbee2mqtt-user-extensions

This repository contains external extensions to be used with Zigbee2MQTT
MIT License
12 stars 7 forks source link

Prometheus metrics #2

Open pmarques opened 1 year ago

pmarques commented 1 year ago

Description

I would like to expose some metrics to prometheus to track explore the data using grafana. @jcarvalho initially suggested this in Koenkk/zigbee2mqtt-user-extensions#5 and there was another PR by @junosuarez Koenkk/zigbee2mqtt/pull/16905. This PR is in fact a rough copy past from @junosuarez initial work in the aforementioned PR and I would like to reopen the discussion to add support for Prometheus metrics as an extension for Zigbee2MQTT.

My use case is purely to expose the current state of the various registered devices (state, LQI, battery, temperature, soli humidity, etc) although I'm aware some people would like to have Zigbee metrics from zigbee-herdsman. Either way, I'm happy to start with basics and extend the use cases as needed.

If we move forward, there are a few things we may need to clarifyÇ

Other alternatives

I'm aware of other alternatives, specially using MQTT exporters, although I would prefer to have less moving parts as well the possibility of having other internal metrics.