Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions collectors/peer_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,17 @@ func (p *PeerCollector) Describe(ch chan<- *prometheus.Desc) {
func (p *PeerCollector) Collect(ch chan<- prometheus.Metric) {
listPeersResp, err := p.lnd.ListPeers(context.Background())
if err != nil {
p.errChan <- fmt.Errorf("PeerCollector ListPeers failed with: "+
"%v", err)
errWithContext := fmt.Errorf("PeerCollector ListPeers failed with: "+
"%w", err)
Logger.Error(errWithContext)

// A deadline exceeded is expected if lnd is temporarily slow
// to respond (e.g. due to database load). We just skip this
// scrape cycle and let Prometheus retry on the next interval.
if !IsDeadlineExceeded(err) {
p.errChan <- errWithContext
}

return
}

Expand Down
Loading