Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collectors: do not init htlc monitor when htlc monitoring is disabled #106

Merged
merged 1 commit into from
Feb 7, 2024
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
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 {
guggero marked this conversation as resolved.
Show resolved Hide resolved
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
Loading