mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-22 15:44:20 +01:00
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 <darosior@protonmail.com>
This commit is contained in:
committed by
Christian Decker
parent
a155107857
commit
2d2fa72ce6
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user