nix-bitcoin icon indicating copy to clipboard operation
nix-bitcoin copied to clipboard

Add default monitoring configuration

Open reardencode opened this issue 5 years ago • 9 comments

I don't think that nix-bitcoin should go so far as to install a complete monitoring and visualization stack, but some basic service status alerting could be really useful.

One example of how this can be achieved is:

https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/blob/master/default.nix#L576

reardencode avatar May 28 '20 13:05 reardencode

Would be nice to provide prometheus exporters, personally I'd run prometheus+grafana on separate machine:

  • https://github.com/jvstein/bitcoin-prometheus-exporter
  • https://github.com/lightningd/plugins/tree/master/prometheus (#71 related)
  • lnd has built-in exporter which has to be enabled at compile time

mmilata avatar May 29 '20 22:05 mmilata

As far as I know monit can only send alerts via email. That's easy to do from a mail server, but not for us really.

I have a prometheus + grafana setup with lnd. You can change the package used by the lnd module with the package option in order to use an lnd with the compilation flag enabled. However, the default metrics it exports are not useful. You really want https://github.com/lightninglabs/lndmon too. I'm relatively happy with that setup (though lndmon should export more things), prometheus queries and alerting through grafana is quite powerful.

Perhaps we should 1) make it easy to enable prometheus exporters and 2) add an option that enables a prometheus/grafana setup that "just works".

jonasnick avatar May 31 '20 19:05 jonasnick

Opened nixpkgs PR for the bitcoind exporter: https://github.com/NixOS/nixpkgs/pull/89267 It's probably more convenient to have it in nixpkgs because there's already a bunch of infrastructure for exporters that I'm not sure can be used from the outside. It's not hard to make it into standalone module though, let me know if there's interest.

mmilata avatar May 31 '20 20:05 mmilata

ACK standalone module and "just works" setup

nixbitcoin avatar Jun 01 '20 17:06 nixbitcoin

lndmon package + module: NixOS/nixpkgs#89449. Let me know if you'd like to become comaintainer.

mmilata avatar Jun 03 '20 23:06 mmilata

IMO we should limit the scope and just make it a matrix or mail notification whenever a systemd service goes down.

nixbitcoin avatar Feb 15 '22 11:02 nixbitcoin