From c8813a7ca44c12b76f0f55aeee556b8ade7b23a3 Mon Sep 17 00:00:00 2001 From: Aljaz Ceru Date: Tue, 14 May 2024 11:00:31 +0200 Subject: [PATCH] fixes --- archived/prometheus/prometheus.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/archived/prometheus/prometheus.py b/archived/prometheus/prometheus.py index df14142..6dbdce7 100755 --- a/archived/prometheus/prometheus.py +++ b/archived/prometheus/prometheus.py @@ -48,10 +48,10 @@ class FundsCollector(BaseLnCollector): funds = self.rpc.listfunds() print(funds['outputs']) output_funds = sum( - [o['amount_msat'].to_satoshi() for o in funds['outputs']] + [o['amount_msat'] // 1000 for o in funds['outputs']] ) channel_funds = sum( - [c['our_amount_msat'].to_satoshi() for c in funds['channels']] + [c['our_amount_msat'] // 1000 for c in funds['channels']] ) total = output_funds + channel_funds @@ -181,10 +181,10 @@ class ChannelsCollector(BaseLnCollector): alias = 'unknown' labels = [c['peer_id'], c.get('short_channel_id', c.get('channel_id')), alias] - balance_gauge.add_metric(labels, c['to_us_msat'].to_satoshi()) + balance_gauge.add_metric(labels, c['to_us_msat'] // 1000 if c['to_us_msat'] else 0) spendable_gauge.add_metric(labels, - c['spendable_msat'].to_satoshi()) - total_gauge.add_metric(labels, c['total_msat'].to_satoshi()) + c['spendable_msat'] // 1000 if c['spendable_msat'] else 0) + total_gauge.add_metric(labels, c['total_msat'] // 1000 if c['total_msat'] else 0) htlc_gauge.add_metric(labels, len(c['htlcs'])) in_payments_offered_gauge.add_metric(labels, c['in_payments_offered'])