Page 1 of 1

Prometheus client for Indigo

PostPosted: Sat Jul 04, 2020 6:42 am
by jheddings
Hello Indigo Community!

I'm messing around with a Prometheus client plugin for Indigo and I thought I'd post my progress so far... I haven't posted it to the Plugin Store until I am certain it's the right way to go. If you give it a shot, let me know how it works out and any changes you'd like to see!

Why another monitoring plugin? Well, the SQL Logger is perfect for logging all state changes. I've been looking for a tool that will display the information as a time-series, rather than a straight log. For example, if a light is on, the SQL Logger will only update if the state changes. But what about all the time in between? I'm trying to build up a view of something like "show me the number of lights on in my house at a certain time if day" or "show me the cumulative watering times for all sprinkler zones in the past month".

The disadvantage with this approach is that you might miss short events. Specifically, anything that changes before the next polling interval. Additionally, devices often have complex state that cannot be easily represented by a simple metric. In a future version, I am considering how to add support for additional metrics (e.g. using custom Devices or specific state names).

There is also some additional overhead running the collection server and Prometheus itself. In initial testing, this setup is easier on my aging Mac Mini than the full SQL Logger. Admittedly, I'm still running both plugins since the logger has other benefits.

Release Page: https://github.com/jheddings/indigo-pro ... tag/v0.1.0

Re: Prometheus client for Indigo

PostPosted: Sun Jul 05, 2020 10:48 am
by jheddings
Just a quick update... After running for a day, I've been able to keep an eye on how many devices are on at a time:

Image

Pretty cool!

Re: Prometheus client for Indigo

PostPosted: Mon Jul 06, 2020 5:02 am
by DaveL17
Neat. I'd not heard of Prometheus before.

Re: Prometheus client for Indigo

PostPosted: Mon Jul 06, 2020 2:04 pm
by matt (support)
DaveL17 wrote:
Neat. I'd not hear of Prometheus before.

Same! Looks interesting, I'm going to definitely have to check it out.

Re: Prometheus client for Indigo

PostPosted: Sun Jul 19, 2020 8:57 pm
by vtmikel
What have you found to be the advantage of Prometheus compared to InfluxDB? I also found that sending DB logs when state changes to be insignificant. My Grafana/Influx plugin has a minimum update period to send updates even without state changes.


Sent from my iPad using Tapatalk Pro

Re: Prometheus client for Indigo

PostPosted: Wed Jul 22, 2020 11:57 am
by jheddings
Honestly, I haven't looked into InfluxDB in great detail... And I'm not an expert on time-series databases, so I probably wouldn't be able to evaluate them fairly. In some of my initial searching, I did appreciate how easy it was to get Prometheus up and running with some basic visualization. My understanding is that InfluxDB does not have any built-in visualization, but that's probably a minor distinction. However the main reason I started with Prometheus was due to using it at work already :D

After I wrote this plugin, I ran across your InfluxDB / Grafana plugin (nice job!). It gave me some ideas (like the discrete plugin) for visualizing device state. For my use case, I prefer managing the Prometheus and Grafana servers external to the plugin, so I can keep all monitoring in a separate service.