martomi / chiadog

A watch dog providing a peace in mind that your Chia farm is running smoothly 24/7.
MIT License
460 stars 123 forks source link

Groundwork for keepalives for all services #368

Closed jinnatar closed 1 year ago

jinnatar commented 1 year ago

This PR deprecates enabling or disabling individual handlers in favor of service level enablement, which in turn enables all handlers defined for that service.

More ground work for fixing #361. At this PR it's already possible to disable harvester monitoring but there are no other keepalives available yet. The next PR in the chain adds a new keepalive for the wallet as an example.

I'm torn on which services should be monitored by default. The conservative default would be no services, but that clashes with the previous default of running all handlers and the harvester keepalive. So I've opted to default to monitoring all services and thus all handlers, which also enables the harvester keepalive. Where it gets a bit wonky then is when we bring in a wallet keepalive. There's been no harm in having the incoming transaction handler enabled by default, but by comparison the peak handler expects to find a working wallet. If one isn't found, it will start triggering keepalive alerts of no wallet activity.

jinnatar commented 1 year ago

The sneak peek of the wallet peak handler and wallet keepalive: https://github.com/Artanicus/chiadog/compare/keepalive...Artanicus:chiadog:keepalive_wallet?expand=1

jinnatar commented 1 year ago

Current code coverage overall with most notifiers enabled (8 tests skipped and Grafana failing) is 78%. Not bad, not great. Keep-alive is at 87%. Biggest misses are:

Then there's actually testing novel situations, will have a think of those wile getting the pure coverage up first.