Instrumentation: Add support for instrumenting database queries (#66022)

Signed-off-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
This commit is contained in:
Carl Bergquist
2023-04-28 15:19:06 +02:00
committed by GitHub
parent e13fff0f21
commit 692bb9ed1a
12 changed files with 21 additions and 19 deletions

View File

@@ -119,7 +119,7 @@ func (l *loggerImpl) prepareLogParams(c *contextmodel.ReqContext, duration time.
lvl = lvl.HighestOf(errutil.LevelWarn)
}
if l.flags.IsEnabled(featuremgmt.FlagDatabaseMetrics) {
if l.cfg.DatabaseInstrumentQueries {
logParams = append(logParams, "db_call_count", log.TotalDBCallCount(c.Req.Context()))
}