From 2d2fa72ce65aa49a56840a8fe9ff41ffc0736bd7 Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Sun, 31 May 2020 19:14:58 +0200 Subject: [PATCH] prometheus: give short channel id for scid fiels, not long one Also, if the channel isn't confirmed yet (no short_channel_id field), give the long channel id. Signed-off-by: Antoine Poinsot --- prometheus/prometheus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prometheus/prometheus.py b/prometheus/prometheus.py index 0027a6b..f7e5031 100755 --- a/prometheus/prometheus.py +++ b/prometheus/prometheus.py @@ -162,7 +162,7 @@ class ChannelsCollector(BaseLnCollector): peers = self.rpc.listpeers()['peers'] for p in peers: for c in p['channels']: - labels = [p['id'], c['channel_id']] + labels = [p['id'], c.get('short_channel_id', c.get('channel_id'))] balance_gauge.add_metric(labels, c['to_us_msat'].to_satoshi()) spendable_gauge.add_metric(labels, c['spendable_msat'].to_satoshi())