Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prom: Add base and proportional fee to the channel metric. #460

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions prometheus/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ def collect(self):
'How many HTLCs are currently active on this channel?',
labels=['id', 'scid', 'alias'],
)
fee_base_msat_gauge = GaugeMetricFamily(
'lightning_channel_fee_base_msat',
'How many msats do we charge as a base fee for routing?',
labels=['id', 'scid', 'alias'],
)
fee_proportional_millionths_gauge = GaugeMetricFamily(
'lightning_channel_fee_proportional_millionths',
'How many millionths of the forwarded amount do we charge for routing?',
labels=['id', 'scid', 'alias'],
)

# Incoming routing statistics
in_payments_offered_gauge = GaugeMetricFamily(
Expand Down Expand Up @@ -186,6 +196,8 @@ def collect(self):
c['spendable_msat'].to_satoshi())
total_gauge.add_metric(labels, c['total_msat'].to_satoshi())
htlc_gauge.add_metric(labels, len(c['htlcs']))
fee_base_msat_gauge.add_metric(labels, int(c['fee_base_msat']))
fee_proportional_millionths_gauge.add_metric(labels, int(c['fee_proportional_millionths']))

in_payments_offered_gauge.add_metric(labels, c['in_payments_offered'])
in_payments_fulfilled_gauge.add_metric(labels, c['in_payments_fulfilled'])
Expand All @@ -202,6 +214,8 @@ def collect(self):
total_gauge,
spendable_gauge,
balance_gauge,
fee_base_msat_gauge,
fee_proportional_millionths_gauge,
in_payments_offered_gauge,
in_payments_fulfilled_gauge,
in_msatoshi_offered_gauge,
Expand Down
Loading