crowdsecurity/cs-haproxy-spoa-bouncer

[prometheus] Should run inside the group ctx?

Opened this issue · 0 comments

go func() {
http.Handle("/metrics", promhttp.Handler())
listenOn := net.JoinHostPort(
config.PrometheusConfig.ListenAddress,
config.PrometheusConfig.ListenPort,
)
log.Infof("Serving metrics at %s", listenOn+"/metrics")
log.Error(http.ListenAndServe(listenOn, nil))
}()

Noticed within metrics code review should this run inside the group context so gets cancelled once the original context is cancelled.