From 4b4fe7abc195204c01f97d4da137a3413c577955 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 13 Nov 2024 15:06:02 +0100 Subject: [PATCH] refactor(server/v2/telemetry): swap redirects --- server/v2/api/telemetry/server.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/v2/api/telemetry/server.go b/server/v2/api/telemetry/server.go index cd08eb7defae..7e3e066010b6 100644 --- a/server/v2/api/telemetry/server.go +++ b/server/v2/api/telemetry/server.go @@ -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{