@@ -13,6 +13,7 @@ type ChainCollector struct {
13
13
bestBlockHeight * prometheus.Desc
14
14
bestBlockTimestamp * prometheus.Desc
15
15
syncedToChain * prometheus.Desc
16
+ syncedToGraph * prometheus.Desc
16
17
17
18
lnd lndclient.LightningClient
18
19
@@ -41,6 +42,11 @@ func NewChainCollector(lnd lndclient.LightningClient,
41
42
"lnd is synced to the chain" ,
42
43
nil , nil ,
43
44
),
45
+ syncedToGraph : prometheus .NewDesc (
46
+ "lnd_graph_synced" ,
47
+ "lnd is synced to the graph" ,
48
+ nil , nil ,
49
+ ),
44
50
lnd : lnd ,
45
51
errChan : errChan ,
46
52
}
@@ -55,6 +61,7 @@ func (c *ChainCollector) Describe(ch chan<- *prometheus.Desc) {
55
61
ch <- c .bestBlockHeight
56
62
ch <- c .bestBlockTimestamp
57
63
ch <- c .syncedToChain
64
+ ch <- c .syncedToGraph
58
65
}
59
66
60
67
// Collect is called by the Prometheus registry when collecting metrics.
@@ -82,6 +89,11 @@ func (c *ChainCollector) Collect(ch chan<- prometheus.Metric) {
82
89
c .syncedToChain , prometheus .GaugeValue ,
83
90
float64 (boolToInt (resp .SyncedToChain )),
84
91
)
92
+
93
+ ch <- prometheus .MustNewConstMetric (
94
+ c .syncedToGraph , prometheus .GaugeValue ,
95
+ float64 (boolToInt (resp .SyncedToGraph )),
96
+ )
85
97
}
86
98
87
99
func boolToInt (arg bool ) uint8 {
0 commit comments