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
This commit is contained in:
Kristin Laemmert 2023-10-23 07:05:50 -07:00 committed by GitHub
parent 488a60aee6
commit f166202e11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)