nix-bitcoin
                                
                                 nix-bitcoin copied to clipboard
                                
                                    nix-bitcoin copied to clipboard
                            
                            
                            
                        Add default monitoring configuration
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
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
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".
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.
ACK standalone module and "just works" setup
lndmon package + module: NixOS/nixpkgs#89449. Let me know if you'd like to become comaintainer.
IMO we should limit the scope and just make it a matrix or mail notification whenever a systemd service goes down.