refactor(server/v2/telemetry): swap redirects (#22520)
This commit is contained in:
parent
276a667d77
commit
e74799e1c3
@ -67,10 +67,10 @@ func (s *Server[T]) Start(ctx context.Context) error {
|
||||
}
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/", s.metricsHandler)
|
||||
// keeping /metrics for backwards compatibility
|
||||
mux.HandleFunc("/metrics", func(w http.ResponseWriter, r *http.Request) {
|
||||
http.Redirect(w, r, "/", http.StatusMovedPermanently)
|
||||
// /metrics is the default standard path for Prometheus metrics.
|
||||
mux.HandleFunc("/metrics", s.metricsHandler)
|
||||
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
http.Redirect(w, r, "/metrics", http.StatusMovedPermanently)
|
||||
})
|
||||
|
||||
s.server = &http.Server{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user