Closed achille-roussel closed 7 years ago
I don't see any immediate issues with it but I don't like registering stuff with the default handler especially in an opaque and non-reversible way.
No surprises.
Why is this required/needed?
I'd be against this as a default, /metrics is somewhat generic (e.g. we use it in the metrics.segment.com service).
If it must, maybe as a more explicit import in a subpackage - import _ "..../promethues/handler"
(though at that point you might as well call http.Handle
yourself as well).
/metrics
is the standard endpoint for prometheus.
This change would be for convenience, if you have to import another package to replace one line of code it seems like it's not really worth it :P
Also just thinking that if an external service were to be using this, this would implicitly expose /metrics
externally? That doesn't seem like the best idea.
Alright you convinced me, that's a bad idea 😛
Thanks for your input guys!
@f2prateek @yields @abraithwaite
What do you guys think about making the prometheus handler automatically register to the default http mux when github.com/segmentio/stats/prometheus is imported?
Basically adding this to the prometheus package: