lightninglabs / lndmon

🔎lndmon: A drop-in monitoring solution for your lnd node using Prometheus+Grafana
MIT License
149 stars 47 forks source link

config: add rpctimeout #86

Closed wdstorer-bg closed 1 year ago

wdstorer-bg commented 1 year ago

This PR adds an option to set the lndclient RPCTimeout when initializing lndclient. This gives lndmon users the option to increase the timeout beyond the default 30 seconds in cases where the metrics take longer to return.

Note: If not specified, this argument defaults to 30 seconds, which is the lndclient default.

Additional context: We use lndmon for our lnd nodes running in Kubernetes and get frequent timeouts due to latency specific to nodes running with a PostgreSQL backend. As such, it often takes longer than 30 seconds for lndmon to gather metrics resulting in our lndmon pods frequently going into a crashloop status. In issue:78 it was suggested that this could be addressed, on the lndmon side, by increasing the lndclient timeout. This seems to be a good workaround for us so I wanted to present this PR for consideration. Thank you!