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:
co-authored by
Christopher Moyer
parent
e13fff0f21
commit
692bb9ed1a
@@ -519,6 +519,12 @@ type Cfg struct {
|
||||
GRPCServerTLSConfig *tls.Config
|
||||
|
||||
CustomResponseHeaders map[string]string
|
||||
|
||||
// DatabaseInstrumentQueries is used to decide if database queries
|
||||
// should be instrumented with metrics, logs and traces.
|
||||
// This needs to be on the global object since its used in the
|
||||
// sqlstore package and HTTP middlewares.
|
||||
DatabaseInstrumentQueries bool
|
||||
}
|
||||
|
||||
// AddChangePasswordLink returns if login form is disabled or not since
|
||||
@@ -1189,6 +1195,9 @@ func (cfg *Cfg) Load(args CommandLineArgs) error {
|
||||
|
||||
cfg.LogConfigSources()
|
||||
|
||||
databaseSection := iniFile.Section("database")
|
||||
cfg.DatabaseInstrumentQueries = databaseSection.Key("instrument_queries").MustBool(false)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user