micw / tibber-pulse-reader

A tool to read data directly from tibber pulse and publish it locally
43 stars 7 forks source link

Why no metrics endpoint/prometheus? #23

Closed hkuehl closed 11 months ago

hkuehl commented 12 months ago

Awesome project! It really took me some time to find this one. I collect all my house metrics in Prometheus so bridging the gap between the smart meter and my prom instance is not straightforward.

As much as I like your adoption of openmetrics, why not also expose the metrics in Prometheus format to scrape them? Would make my local setup easier and skip the pushgateway🙂

There is probably a good reason but if not I am happy to create a PR.

micw commented 12 months ago

No reason except there was no need for it up to now. I run my metrics server outside my home, so I cannot scrape and always use push. But there's no reason not to have it.

I have integrated the code from tibber-pulse-reader to https://github.com/micw/homedatabroker. It can be used the same way as tibber-pulse-reader but it is more general and has more metric sources and sinks. I'd add a scrape endpoint there.

micw commented 12 months ago

Have a look at https://github.com/micw/homedatabroker/tree/feature/webui?tab=readme-ov-file#web-ui if that works for you. I named the endpoint /metrics/sources because I want to add application metrics (are the sources and outputs working, ...) to /metrics in a later release.

Image is available for testing at ghcr.io/micw/homedatabroker:feature-webui

hkuehl commented 11 months ago

Closing this one and will reopen a new one over at Home Data Broker-repo.