mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 01:16:31 -06:00
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:
parent
488a60aee6
commit
f166202e11
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user