lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.7k stars 2.09k forks source link

etcd metrics are initialized regardless of configured storage backend #6138

Open tanuck opened 2 years ago

tanuck commented 2 years ago

Background

We've just upgraded to 0.14 and noticed that lnd now exports all etcd_* metric series associated with an etcd node, even when you're using the default database. Is this by design? All of the etcd series remain in their initial state, which causes common etcd alerts to fire (eg etcd_server_has_leader == 0).

Your environment

Steps to reproduce

Run lnd 0.14 using any storage backend other than etcd.

Expected behaviour

lnd would only export etcd_* metrics when the built-in etcd storage backend is selected.

Roasbeef commented 2 years ago

We build with it on by default now, which may end up exporting those metrics. You can re-build with the tag off if you aren't using it at all.

Also we're talking Prometheus here, right?

tanuck commented 2 years ago

Yes, sorry, Prometheus metrics.

Yeah, we used to build our own releases but have just moved away from that for simplicity.

Roasbeef commented 2 years ago

Gotcha, I'm assuming there's an init() func somewhere in the module import path that automatically registers the etcd metrics...