Add v1 to metrics API endpoint

Fixes #1399

This versions the prometheus metrics API so we can manage backwards
incompatible changes in the future more easily.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-09-20 16:24:30 -04:00
parent 9934acb271
commit f23edd3cc0
3 changed files with 11 additions and 2 deletions

View File

@@ -136,7 +136,7 @@ func (s *Server) ServeGRPC(l net.Listener) error {
// ServeMetrics provides a prometheus endpoint for exposing metrics
func (s *Server) ServeMetrics(l net.Listener) error {
m := http.NewServeMux()
m.Handle("/metrics", metrics.Handler())
m.Handle("/v1/metrics", metrics.Handler())
return trapClosedConnErr(http.Serve(l, m))
}