Skip to content

Commit c5cb503

Browse files
committed
collectors: fix formatting
1 parent 892dae7 commit c5cb503

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

collectors/prometheus.go

+18-10
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ type MonitoringConfig struct {
7272
// DisableHtlc disables collection of HTLCs metrics
7373
DisableHtlc bool
7474

75-
// ProgramStartTime stores a best-effort estimate of when lnd/lndmon was started.
75+
// ProgramStartTime stores a best-effort estimate of when lnd/lndmon was
76+
// started.
7677
ProgramStartTime time.Time
7778
}
7879

@@ -88,13 +89,14 @@ func DefaultConfig() *PrometheusConfig {
8889
// NewPrometheusExporter makes a new instance of the PrometheusExporter given
8990
// the address to listen for Prometheus on and an lnd gRPC client.
9091
func NewPrometheusExporter(cfg *PrometheusConfig, lnd *lndclient.LndServices,
91-
monitoringCfg *MonitoringConfig, quitChan chan struct{}) *PrometheusExporter {
92+
monitoringCfg *MonitoringConfig,
93+
quitChan chan struct{}) *PrometheusExporter {
9294

9395
// We have six collectors and a htlc monitor running, so we buffer our
94-
// error channel by 7 so that we do not need to consume all errors from
96+
// error channel by 8 so that we do not need to consume all errors from
9597
// this channel (on the first one, we'll start shutting down, but a few
9698
// could arrive quickly in the case where lnd is shutting down).
97-
errChan := make(chan error, 7)
99+
errChan := make(chan error, 8)
98100

99101
htlcMonitor := newHtlcMonitor(lnd.Router, errChan)
100102

@@ -116,7 +118,9 @@ func NewPrometheusExporter(cfg *PrometheusConfig, lnd *lndclient.LndServices,
116118
}
117119

118120
if !monitoringCfg.DisableGraph {
119-
collectors = append(collectors, NewGraphCollector(lnd.Client, errChan))
121+
collectors = append(
122+
collectors, NewGraphCollector(lnd.Client, errChan),
123+
)
120124
}
121125

122126
return &PrometheusExporter{
@@ -165,15 +169,19 @@ func (p *PrometheusExporter) Start() error {
165169
// scape our metrics.
166170
go func() {
167171
errorLogger := log.New(
168-
os.Stdout, "promhttp", log.Ldate|log.Ltime|log.Lshortfile,
172+
os.Stdout, "promhttp",
173+
log.Ldate|log.Ltime|log.Lshortfile,
169174
)
170175

171176
promHandler := promhttp.InstrumentMetricHandler(
172177
prometheus.DefaultRegisterer,
173-
promhttp.HandlerFor(prometheus.DefaultGatherer, promhttp.HandlerOpts{
174-
ErrorLog: errorLogger,
175-
ErrorHandling: promhttp.ContinueOnError,
176-
}),
178+
promhttp.HandlerFor(
179+
prometheus.DefaultGatherer,
180+
promhttp.HandlerOpts{
181+
ErrorLog: errorLogger,
182+
ErrorHandling: promhttp.ContinueOnError,
183+
},
184+
),
177185
)
178186
http.Handle("/metrics", promHandler)
179187
Logger.Info(http.ListenAndServe(p.cfg.ListenAddr, nil))

0 commit comments

Comments
 (0)