feat: log slow queries even without query logging (#23320)

Log long-running queries if "log-queries-after" > 0,
even if general query logging is not enabled.

closes https://github.com/influxdata/influxdb/issues/23147
pull/23341/head
davidby-influx 2022-05-11 13:12:09 -07:00 committed by GitHub
parent a894717c2c
commit 1c89102276
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -458,6 +458,9 @@ func (s *Server) Open() error {
s.TSDBStore.WithLogger(s.Logger)
if s.config.Data.QueryLogEnabled {
s.QueryExecutor.WithLogger(s.Logger)
} else if s.config.Coordinator.LogQueriesAfter > 0 {
// Log long-running queries even if not logging all queries
s.QueryExecutor.TaskManager.Logger = s.Logger
}
s.PointsWriter.WithLogger(s.Logger)
s.Subscriber.WithLogger(s.Logger)