@@ -30,9 +30,6 @@ type WalletCollector struct {
3030 confirmedBalanceDesc * prometheus.Desc
3131 unconfirmedBalanceDesc * prometheus.Desc
3232
33- // Per-transaction metrics.
34- txNumConfsDesc * prometheus.Desc
35-
3633 // errChan is a channel that we send any errors that we encounter into.
3734 // This channel should be buffered so that it does not block sends.
3835 errChan chan <- error
@@ -42,7 +39,6 @@ type WalletCollector struct {
4239func NewWalletCollector (lnd * lndclient.LndServices ,
4340 errChan chan <- error ) * WalletCollector {
4441
45- txLabels := []string {"tx_hash" }
4642 return & WalletCollector {
4743 lnd : lnd ,
4844 numUtxosConfDesc : prometheus .NewDesc (
@@ -75,9 +71,6 @@ func NewWalletCollector(lnd *lndclient.LndServices,
7571 "unconfirmed wallet balance" ,
7672 nil , nil ,
7773 ),
78- txNumConfsDesc : prometheus .NewDesc (
79- "lnd_tx_num_confs" , "number of confs" , txLabels , nil ,
80- ),
8174 errChan : errChan ,
8275 }
8376}
@@ -95,7 +88,6 @@ func (u *WalletCollector) Describe(ch chan<- *prometheus.Desc) {
9588 ch <- u .avgUtxoSizeDesc
9689 ch <- u .confirmedBalanceDesc
9790 ch <- u .unconfirmedBalanceDesc
98- ch <- u .txNumConfsDesc
9991}
10092
10193// Collect is called by the Prometheus registry when collecting metrics.
@@ -177,20 +169,4 @@ func (u *WalletCollector) Collect(ch chan<- prometheus.Metric) {
177169 u .unconfirmedBalanceDesc , prometheus .GaugeValue ,
178170 float64 (walletBal .Unconfirmed ),
179171 )
180-
181- getTxsResp , err := u .lnd .Client .ListTransactions (
182- context .Background (), 0 , 0 ,
183- )
184- if err != nil {
185- u .errChan <- fmt .Errorf ("WalletCollector ListTransactions " +
186- "failed with: %v" , err )
187- return
188- }
189-
190- for _ , tx := range getTxsResp {
191- ch <- prometheus .MustNewConstMetric (
192- u .txNumConfsDesc , prometheus .CounterValue ,
193- float64 (tx .Confirmations ), tx .TxHash ,
194- )
195- }
196172}
0 commit comments