numat / tripplite

Python USB HID interface to Tripplite UPS battery backups.
GNU General Public License v2.0
31 stars 12 forks source link

Add a prometheus_exporter as an extra install to module #5

Closed cooperlees closed 4 years ago

cooperlees commented 4 years ago

Would my prometheus_exporter, based on this module to pull data from my UPS, be accepted as an addition to this great module?

Dashboard I've built from the data collected:

Screen Shot 2020-09-26 at 10 26 58 AM
patrickfuller commented 4 years ago

This is cool!

I don't think UI belongs in this repo (I'd like to keep this dedicated to simply reading the battery) but I'd be happy to link to it in the README. Let me know if you publish it and I'll add the hyperlink.

EDIT - I'm on board if this exporter is just exporting data in a different format. We don't even need to make it an extra. We could have a kwarg on get or similar.

cooperlees commented 4 years ago

A prometheus exporter does just change the format, but it also runs a small http server for prometheus to come and scrape via HTTP at a period configured by the admin.

The extra dependency, prometheus_client, is the main reason I thought adding as an extra would make sense so people who are using the library today don't pick up the extra dependency unless they actually want it.

patrickfuller commented 4 years ago

Agreed. Exporting to a new data format belongs here, and an added dependency belongs in an extra install. Happy to accept a PR here.

cooperlees commented 4 years ago

Thanks! Will polish it all up and make it solid before I put up the PR.