Skip to content

Commit

Permalink
collectors: do not start htlc monitor when htlc monitoring is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Feb 7, 2024
1 parent a849499 commit 79f80d3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions collectors/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,10 @@ func (p *PrometheusExporter) Start() error {

// Start the htlc monitor goroutine. This will subscribe to htlcs and
// update all of our routing-related metrics.
if err := p.htlcMonitor.start(); err != nil {
return err
if !p.monitoringCfg.DisableHtlc {
if err := p.htlcMonitor.start(); err != nil {
return err
}
}

// Finally, we'll launch the HTTP server that Prometheus will use to
Expand Down Expand Up @@ -181,7 +183,9 @@ func (p *PrometheusExporter) Start() error {
// before returning.
func (p *PrometheusExporter) Stop() {
log.Println("Stopping Prometheus Exporter")
p.htlcMonitor.stop()
if !p.monitoringCfg.DisableHtlc {
p.htlcMonitor.stop()
}
}

// Errors returns an error channel that any failures experienced by its
Expand Down

0 comments on commit 79f80d3

Please sign in to comment.