grafana/pkg/services/contexthandler
Marcus Efraimsson caa420f92f
Chore: Improve request distributed tracing middleware (#33033)
Before these changes the request tracing was added for each route 
registered using the routing.RouteRegister, see code. This had the 
consequence that middleware executed earlier/later in the request 
pipeline was not part of the request tracing middleware life-cycle 
which measures the duration of requests among other things.
In the logger middleware we do extract the current distributed trace 
identifier, if available, and set that on request info/error log messages.
With these changes we can extract the current distributed trace identifier, 
if available, and set that on the contextual HTTP request logger 
(models.ReqContext.Logger) which would improve the possibility to correlate 
all HTTP request log messages with traces.
In addition, the request tracing middleware is now executed first and last in 
the request pipeline and should therefore result in more accurate timing 
measurements (request duration).

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-04-20 15:22:22 +02:00
..
authproxy Backend: Remove more globals (#29644) 2020-12-15 19:09:04 +01:00
auth_jwt.go Auth: support JWT Authentication (#29995) 2021-03-31 08:40:44 -07:00
auth_proxy_test.go Auth: support JWT Authentication (#29995) 2021-03-31 08:40:44 -07:00
contexthandler_test.go Backend: Remove more globals (#29644) 2020-12-15 19:09:04 +01:00
contexthandler.go Chore: Improve request distributed tracing middleware (#33033) 2021-04-20 15:22:22 +02:00