Instrumentation: Fix HTTP request instrumentation of authentication failures (#44234) (#44793)

Moves the request tracing middleware earlier in the chain, just after the tracing middleware
and before the log middleware. With these changes we'll be able to track
authentication/authorization status failures that currently exits early and don't execute the
request tracing middleware. In addition, there might be some other routes now being tracked
with this that we didn't do before.

Fixes #39590

(cherry picked from commit 0092d10764)

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2022-02-02 19:07:37 +01:00
committed by GitHub
co-authored by Marcus Efraimsson
parent 0ab7097abc
commit 918f1d943a
3 changed files with 51 additions and 41 deletions
+1
View File
@@ -432,6 +432,7 @@ func (hs *HTTPServer) addMiddlewaresAndStaticRoutes() {
m := hs.web
m.Use(middleware.RequestTracing(hs.tracer))
m.Use(middleware.RequestMetrics(hs.Features))
m.Use(middleware.Logger(hs.Cfg))