Skip to content

Commit

Permalink
feat: log slow queries even without query logging (influxdata#23320)
Browse files Browse the repository at this point in the history
Log long-running queries if "log-queries-after" > 0,
even if general query logging is not enabled.

closes influxdata#23147
  • Loading branch information
davidby-influx authored and chengshiwen committed Sep 1, 2024
1 parent c76252a commit b650e71
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/influxd/run/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,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)
Expand Down

0 comments on commit b650e71

Please sign in to comment.