Conversation
| // 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{}) | ||
| } |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
what is the use case for having multiple prometheus registries? Are there some applications that expose two different sets of /metrics endpoints?
One reason might be that you don't want/need all the default metrics (cpu, mem, fds ...) that are added to the default registry.
So you just create an empty registry and only add the metrics you are interested in.
Fixes #1