Skip to content

Commit

Permalink
Add base and proportional fee to the channel metric.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Lee committed Jun 23, 2023
1 parent 1713f9a commit f2c6c88
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions prometheus/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,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 @@ -175,6 +185,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, c['fee_base_msat'])
fee_proportional_millionths_gauge.add_metric(labels, 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 @@ -191,6 +203,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

0 comments on commit f2c6c88

Please sign in to comment.