[v7.5.x]: FrontendMetrics: Adds new backend api that frontend can use to push frontend measurements and counters to prometheus (#33255)

* Backport of https://github.com/grafana/grafana/pull/32593

* Update prometheus.yml
This commit is contained in:
Torkel Ödegaard
2021-04-23 10:00:48 +02:00
committed by GitHub
parent 37d1df05fd
commit fc11be7250
10 changed files with 105 additions and 25 deletions
+3
View File
@@ -10,6 +10,7 @@ import (
"github.com/grafana/grafana/pkg/api/frontendlogging"
"github.com/grafana/grafana/pkg/api/routing"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/metrics"
"github.com/grafana/grafana/pkg/middleware"
"github.com/grafana/grafana/pkg/models"
)
@@ -397,6 +398,8 @@ func (hs *HTTPServer) registerRoutes() {
annotationsRoute.Post("/graphite", reqEditorRole, bind(dtos.PostGraphiteAnnotationsCmd{}), routing.Wrap(PostGraphiteAnnotation))
})
apiRoute.Post("/frontend-metrics", bind(metrics.PostFrontendMetricsCommand{}), routing.Wrap(hs.PostFrontendMetrics))
// short urls
apiRoute.Post("/short-urls", bind(dtos.CreateShortURLCmd{}), routing.Wrap(hs.createShortURL))
}, reqSignedIn)