From f166202e11d3b9f9b9002bd76b77330ac2155358 Mon Sep 17 00:00:00 2001 From: Kristin Laemmert Date: Mon, 23 Oct 2023 07:05:50 -0700 Subject: [PATCH] chore(grafana-apiserver): expose apiserver metrics endpoint (#76572) expose apiserver metrics Add a route to the apiserver metrics on a new endpoint, `/apiserver-metrics`. This requires a signed-in user but otherwise ignores the MetricsEndpoind-relating configuration. that will come in a following PR --- pkg/services/grafana-apiserver/service.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/services/grafana-apiserver/service.go b/pkg/services/grafana-apiserver/service.go index a142c094cb5..9679cd05ef6 100644 --- a/pkg/services/grafana-apiserver/service.go +++ b/pkg/services/grafana-apiserver/service.go @@ -140,6 +140,7 @@ func ProvideService( } s.rr.Group("/apis", proxyHandler) + s.rr.Group("/apiserver-metrics", proxyHandler) s.rr.Group("/openapi", proxyHandler) return s, nil @@ -294,6 +295,12 @@ func (s *service) start(ctx context.Context) error { if req.URL.Path == "" { req.URL.Path = "/" } + + //TODO: add support for the existing MetricsEndpointBasicAuth config option + if req.URL.Path == "/apiserver-metrics" { + req.URL.Path = "/metrics" + } + ctx := req.Context() signedInUser := appcontext.MustUser(ctx)