@@ -13,6 +13,7 @@ type ChainCollector struct {
1313 bestBlockHeight * prometheus.Desc
1414 bestBlockTimestamp * prometheus.Desc
1515 syncedToChain * prometheus.Desc
16+ syncedToGraph * prometheus.Desc
1617
1718 lnd lndclient.LightningClient
1819
@@ -41,6 +42,11 @@ func NewChainCollector(lnd lndclient.LightningClient,
4142 "lnd is synced to the chain" ,
4243 nil , nil ,
4344 ),
45+ syncedToGraph : prometheus .NewDesc (
46+ "lnd_graph_synced" ,
47+ "lnd is synced to the graph" ,
48+ nil , nil ,
49+ ),
4450 lnd : lnd ,
4551 errChan : errChan ,
4652 }
@@ -55,6 +61,7 @@ func (c *ChainCollector) Describe(ch chan<- *prometheus.Desc) {
5561 ch <- c .bestBlockHeight
5662 ch <- c .bestBlockTimestamp
5763 ch <- c .syncedToChain
64+ ch <- c .syncedToGraph
5865}
5966
6067// Collect is called by the Prometheus registry when collecting metrics.
@@ -82,6 +89,11 @@ func (c *ChainCollector) Collect(ch chan<- prometheus.Metric) {
8289 c .syncedToChain , prometheus .GaugeValue ,
8390 float64 (boolToInt (resp .SyncedToChain )),
8491 )
92+
93+ ch <- prometheus .MustNewConstMetric (
94+ c .syncedToGraph , prometheus .GaugeValue ,
95+ float64 (boolToInt (resp .SyncedToGraph )),
96+ )
8597}
8698
8799func boolToInt (arg bool ) uint8 {
0 commit comments