Skip to content

fix: use prometheus default registry #4907

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

Merged
merged 1 commit into from
Nov 4, 2022
Merged

fix: use prometheus default registry #4907

merged 1 commit into from
Nov 4, 2022

Conversation

coadler
Copy link
Contributor

@coadler coadler commented Nov 4, 2022

Using a custom registry got rid of all of the default runtime metrics.

Using a custom registry got rid of all of the default runtime metrics.
@coadler coadler self-assigned this Nov 4, 2022
@coadler coadler enabled auto-merge (squash) November 4, 2022 19:56
@@ -505,23 +505,21 @@ func Server(vip *viper.Viper, newAPI func(context.Context, *coderd.Options) (*co
defer serveHandler(ctx, logger, nil, cfg.Pprof.Address.Value, "pprof")()
}
if cfg.Prometheus.Enable.Value {
options.PrometheusRegistry = prometheus.NewRegistry()
closeUsersFunc, err := prometheusmetrics.ActiveUsers(ctx, options.PrometheusRegistry, options.Database, 0)
options.PrometheusRegisterer = prometheus.DefaultRegisterer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This technically breaks tests, because it adds global state. How easy is it to attach the default metrics?

@coadler coadler merged commit 8dd567d into main Nov 4, 2022
@coadler coadler deleted the colin/fix-prom branch November 4, 2022 20:19
@github-actions github-actions bot locked and limited conversation to collaborators Nov 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants