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

[prometheus] Should run inside the group ctx? #15

Open
LaurenceJJones opened this issue Oct 15, 2024 · 0 comments
Open

[prometheus] Should run inside the group ctx? #15

LaurenceJJones opened this issue Oct 15, 2024 · 0 comments

Comments

@LaurenceJJones
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant