Skip to content

Commit

Permalink
Merge pull request #106 from LN-Zap/disable-htlc-stream
Browse files Browse the repository at this point in the history
collectors: do not init htlc monitor when htlc monitoring is disabled
  • Loading branch information
guggero authored Feb 7, 2024
2 parents a849499 + 79f80d3 commit 02ee7ca
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 02ee7ca

Please sign in to comment.