From 6d0df3c83bd5098ca084b04ba8f589f33a609b8e Mon Sep 17 00:00:00 2001 From: Stadicus Date: Mon, 13 May 2019 14:38:01 +0200 Subject: [PATCH] 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. --- prometheus/prometheus.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/prometheus/prometheus.py b/prometheus/prometheus.py index 1ca68db..b5789ba 100755 --- a/prometheus/prometheus.py +++ b/prometheus/prometheus.py @@ -25,6 +25,13 @@ class NodeCollector(BaseLnCollector): node_info_fam.add_metric(info_labels, info_labels) yield node_info_fam + blockheight = info['blockheight'] + yield GaugeMetricFamily( + 'lightning_node_blockheight', + "Current Bitcoin blockheight on this node.", + value=blockheight, + ) + class FundsCollector(BaseLnCollector): def collect(self):