Add support for querylog-time-threshold duration flag for query logging#18520
Merged
dbussink merged 2 commits intovitessio:mainfrom Jul 30, 2025
Merged
Add support for querylog-time-threshold duration flag for query logging#18520dbussink merged 2 commits intovitessio:mainfrom
dbussink merged 2 commits intovitessio:mainfrom
Conversation
…ag for query logging This fixes issue: vitessio#18456 Currently vtgate/vttable query log supports flag --querylog-row-threshold uint to emit query log when the row count is over a threshold. This PR adds the flag --querylog-time-threshold time.duration to emit query log when the query execution time over the time threshold. On MySQL side, we have slow-query-log which emits slow query based on either execution time or affected rows, it would be good vtgate/tablet can issue the query log using the same criteria so we can correlate the log from both vitess and mysql sides. The implementation pretty much followed the code path for querylog-row-threshold, the new flag querylog-time-threshold takes in a duration argument. The duration can be expressed in a form recognized by time.ParseDuration (e.g. 300ms, 100ns). Unit tests are added to cover the new querylog-time-threshold Signed-off-by: Henry Cai <henry.cai@slack-corp.com>
Signed-off-by: Henry Cai <henry.cai@slack-corp.com>
Contributor
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
harshit-gangal
approved these changes
Jul 30, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18520 +/- ##
=======================================
Coverage 67.50% 67.50%
=======================================
Files 1607 1607
Lines 263046 263093 +47
=======================================
+ Hits 177561 177605 +44
- Misses 85485 85488 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
As this is a new enhancement and not a bug fix, it won't be back ported. |
dbussink
approved these changes
Jul 30, 2025
HenryCaiHaiying
added a commit
to slackhq/vitess
that referenced
this pull request
Aug 24, 2025
…ng (vitessio#18520) Signed-off-by: Henry Cai <henry.cai@slack-corp.com>
tanjinx
pushed a commit
to slackhq/vitess
that referenced
this pull request
Aug 25, 2025
…ng (vitessio#18520) (#693) Signed-off-by: Henry Cai <henry.cai@slack-corp.com>
HenryCaiHaiying
added a commit
to slackhq/vitess
that referenced
this pull request
Sep 13, 2025
…ng (vitessio#18520) Signed-off-by: Henry Cai <henry.cai@slack-corp.com>
tanjinx
added a commit
to slackhq/vitess
that referenced
this pull request
Oct 31, 2025
…ng (vitessio#18520) (#710) Signed-off-by: Henry Cai <henry.cai@slack-corp.com> Co-authored-by: Tanjin Xu <109303790+tanjinx@users.noreply.github.com>
tanjinx
added a commit
to slackhq/vitess
that referenced
this pull request
Nov 10, 2025
…ng (vitessio#18520) (#710) Signed-off-by: Henry Cai <henry.cai@slack-corp.com> Co-authored-by: Tanjin Xu <109303790+tanjinx@users.noreply.github.com>
sbaker617
pushed a commit
to slackhq/vitess
that referenced
this pull request
Feb 5, 2026
…ng (vitessio#18520) (#710) Signed-off-by: Henry Cai <henry.cai@slack-corp.com> Co-authored-by: Tanjin Xu <109303790+tanjinx@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Related Issue(s)
Checklist
Deployment Notes
None