cleanup: move to clap 4
cleanup: remove use of deprecated method
cleanup: update to latest serde-xml-rs
This is a small daemon to periodically scrape a Rainforest Automation Eagle 200 and export the data for Prometheus. It's one of my earlier Rust projects, lightly cleaned up for public consumption.
Config format is toml, with the following knobs:
hostname = "FIXME" # IP or hostname of your eagle200
username = "FIXME" # found on the label on your device
password = "FIXME" # found on the label on your device
# You don't have to specify your meter, but if you don't then eagle200d
# won't be able to come up if the meter and the eagle haven't done their
# handshake. This can happen after a power outage, and gets annoying, so
# specifying it explicitly can be nice. When auto-detecting the meter
# address is printed at startup.
# meter_address = "optional"
# By default it'll listen on localhost:8080.
# You probably want to change that?
# listen = "localhost:8080"
Metrics are available on the /metrics endpoint. If you need to kill the exporter over the network (it used to get stuck a lot for me), you can hit the /quitquitquit endpoint, and then your init system will hopefully restart it for you.
I've observed some weirdness in the Eagle's local API. Most of the time it returns load in kW as a string, eg "0.435 kW" is 435 watts of load, but occasionally it'll return a bare integer number of watts (that is, "435") instead. It'll also sometimes give an empty value back. I keep meaning to add debug code and try and come up with a bug report to send to the Rainforest folks, but I haven't yet done so.