[v9.2.x] Plugins: Add username to datasource plugin logging (#59947)

Plugins: Add username to datasource plugin logging (#59893)

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Signed-off-by: bergquist <carl.bergquist@gmail.com>
(cherry picked from commit a5ace56be8)

Co-authored-by: Carl Bergquist <carl.bergquist@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2022-12-07 13:43:35 +01:00
committed by GitHub
co-authored by Carl Bergquist
parent 2919588a82
commit 6c73fd2635
3 changed files with 37 additions and 0 deletions
+2
View File
@@ -35,6 +35,8 @@ func Logger(cfg *setting.Cfg) web.Middleware {
// we have to init the context with the counter here to update the request
r = r.WithContext(log.InitCounter(r.Context()))
// put the start time on context so we can measure it later.
r = r.WithContext(log.InitstartTime(r.Context(), time.Now()))
rw := web.Rw(w, r)
next.ServeHTTP(rw, r)