-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add the ability to log queries killed by query-timeout
#23978
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add more information to the logging.
if t.LogTimedoutQueries { | ||
t.Logger.Warn( | ||
"query killed for exceeding timeout limit", | ||
zap.String("query", t.queries[qid].query), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could put a little more information in here, as we do in LogCurrentQueries
: particularly the database and the elapsed time. "query killed for exceeding timeout limit of 30s on database MyDatabase" This will save some lookup for the reader, e.g., "What was that timeout?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this is out of scope, but in addition to logging the time limit / database many users want to know the user/client that executed query. eg "query sent from iclark@influxdata.com against database: Foodb exceeded timeout of 1 mins"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @idclark, while I like the suggestion unfortunately the plumbing to support that doesn't exist and would be a pretty heavy overhaul to implement. Something we can keep in mind if we are ever doing work in that area though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* feat: add the ability to log queries killed by `query-timeout` * chore: update example config * chore: improve logging details
… (#24048) * feat: add the ability to log queries killed by `query-timeout` * chore: update example config * chore: improve logging details
…xdata#23978) * feat: add the ability to log queries killed by `query-timeout` * chore: update example config * chore: improve logging details
…xdata#23978) * feat: add the ability to log queries killed by `query-timeout` * chore: update example config * chore: improve logging details
Required checklist
/etc
folder andNewDemoConfig
methods) (influxdb and plutonium)Description
Adds a flag to log when a query is killed for exceeding the timeout.
Context
There is no currently no easy way to see what query might be leading to a timeout.
Affected areas (delete section if not relevant):
Adds a new config option.
Note for reviewers:
Check the semantic commit type: