Instrumentation: log the total number of db queries per request (#54647) (#54686)

Signed-off-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
(cherry picked from commit 78978048c3)
This commit is contained in:
Carl Bergquist
2022-09-05 11:58:35 +02:00
committed by GitHub
parent 4f924a9b97
commit 8790142aef
4 changed files with 78 additions and 0 deletions
@@ -93,6 +93,8 @@ func (h *databaseQueryWrapper) instrument(ctx context.Context, status string, qu
histogram.Observe(elapsed.Seconds())
}
ctx = log.IncDBCallCounter(ctx)
_, span := h.tracer.Start(ctx, "database query")
defer span.End()