add lightningd blockheight metric

This metric is useful on initial sync, when bitcoind is already synced, but lightningd is still working through the blocks.
Comparing the two measures allows to calculate the indexing progress.
This commit is contained in:
Stadicus
2019-05-13 14:38:01 +02:00
committed by Christian Decker
parent 34f81103a4
commit 6d0df3c83b

View File

@@ -25,6 +25,13 @@ class NodeCollector(BaseLnCollector):
node_info_fam.add_metric(info_labels, info_labels) node_info_fam.add_metric(info_labels, info_labels)
yield node_info_fam yield node_info_fam
blockheight = info['blockheight']
yield GaugeMetricFamily(
'lightning_node_blockheight',
"Current Bitcoin blockheight on this node.",
value=blockheight,
)
class FundsCollector(BaseLnCollector): class FundsCollector(BaseLnCollector):
def collect(self): def collect(self):