Skip to content
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

Merged
merged 3 commits into from
Jan 10, 2023

Conversation

jeffreyssmith2nd
Copy link
Contributor

Required checklist

  • Sample config files updated (both /etc folder and NewDemoConfig 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:

  • Feat: a feature with user-visible changes
  • Fix: a bug fix that we might tell a user “upgrade to get this fix for your issue”
  • Chore: version bumps, internal doc (e.g. README) changes, code comment updates, code formatting fixes… must not be user facing (except dependency version changes)
  • Build: build script changes, CI config changes, build tool updates
  • Refactor: non-user-visible refactoring
  • Check the PR title: we should be able to put this as a one-liner in the release notes

@jeffreyssmith2nd jeffreyssmith2nd marked this pull request as ready for review December 13, 2022 21:12
Copy link
Contributor

@davidby-influx davidby-influx left a 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),
Copy link
Contributor

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?"

Copy link

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"

Copy link
Contributor Author

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.

Copy link
Contributor

@davidby-influx davidby-influx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jeffreyssmith2nd jeffreyssmith2nd merged commit 88d2760 into master-1.x Jan 10, 2023
@jeffreyssmith2nd jeffreyssmith2nd deleted the smith/add-query-timeout-logging branch January 10, 2023 18:37
jeffreyssmith2nd added a commit that referenced this pull request Jan 18, 2023
* feat: add the ability to log queries killed by `query-timeout`

* chore: update example config

* chore: improve logging details
jeffreyssmith2nd added a commit that referenced this pull request Jan 20, 2023
… (#24048)

* feat: add the ability to log queries killed by `query-timeout`

* chore: update example config

* chore: improve logging details
chengshiwen pushed a commit to chengshiwen/influxdb that referenced this pull request Sep 1, 2024
…xdata#23978)

* feat: add the ability to log queries killed by `query-timeout`

* chore: update example config

* chore: improve logging details
chengshiwen pushed a commit to chengshiwen/influxdb that referenced this pull request Sep 1, 2024
…xdata#23978)

* feat: add the ability to log queries killed by `query-timeout`

* chore: update example config

* chore: improve logging details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants