Skip to content

Conversation

@brpaz
Copy link

@brpaz brpaz commented Sep 13, 2025

Fixes #1

// e.g. via middleware.BasicAuth or exposed only on a private port.
func HandlerFor(registry *prometheus.Registry) http.Handler {
return promhttp.HandlerFor(registry, promhttp.HandlerOpts{})
}
Copy link
Contributor

@VojtechVitek VojtechVitek Nov 14, 2025

Choose a reason for hiding this comment

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

I designed this package to be agnostic of the github.com/prometheus/client_golang/prometheus dependency. We don't necessarily need to stick with it into the future.

However, this PR would buy us into the prometheus.Registerer and prometheus.Registry types for good.

I like what you have done in this PR and it makes sense to me. However, for the above reason, I'm hesitant to merge it.

@brpaz It might be an obvious questions -- but what is the use case for having multiple prometheus registries? Are there some applications that expose two different sets of /metrics endpoints?

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

Successfully merging this pull request may close these issues.

Support custom prometheus registry

2 participants