lightninglabs / lndmon

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

collectors: add inbound fee metric #54

Closed joostjager closed 3 years ago

joostjager commented 4 years ago

This PR adds a cumulative metric for the routing fee that senders need to pay to the last hop to reach the node that is being monitored. It is an indication of the quality of inbound liquidity.

Example output to Prometheus:

# HELP inbound_fee fee charged for forwarding to this node
# TYPE inbound_fee gauge
inbound_fee{amount="0.001 BTC"} 4e-05
inbound_fee{amount="0.002 BTC"} 4.5e-05
inbound_fee{amount="0.004 BTC"} 4.75e-05
inbound_fee{amount="0.008 BTC"} 7.75e-05
inbound_fee{amount="0.016 BTC"} 0.00030125
inbound_fee{amount="0.032 BTC"} 0.000650625
inbound_fee{amount="0.064 BTC"} 0.00082515625
inbound_fee{amount="0.128 BTC"} 0.000912578125

When used in a primary-gateway setup, it is typically required to ignore the internal channels for this metric. This can be indicated by passing the pubkey of the primary node via the --primarynode command line flag.

joostjager commented 4 years ago

Found one nil pointer bug while testing on staging, fixed.

joostjager commented 3 years ago

I wanted to do a bit more testing before merge and also update the json dashboard files. But can do that in a follow-up PR.