-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add support for sampling rate in streamlog
#15919
Add support for sampling rate in streamlog
#15919
Conversation
Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
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
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15919 +/- ##
==========================================
- Coverage 68.40% 68.24% -0.17%
==========================================
Files 1556 1541 -15
Lines 195121 197179 +2058
==========================================
+ Hits 133479 134571 +1092
- Misses 61642 62608 +966 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
Hello! 👋 This Pull Request is now handled by arewefastyet. The current HEAD and future commits will be benchmarked. You can find the performance comparison on the arewefastyet website. |
Flag docs are auto-generated, so we don't need any manual changes on the website for this. @frouioui can you confirm that I'm getting this right? |
@deepthi according https://github.com/vitessio/vitess-bot/blob/main/README.md#vitess-bot it should generate a PR upon merge to |
After talking with @mattlord, I realized that actually the automation does not work. We should update the website docs manually at the same time as this PR. |
Right, I forgot this is automatic now, thanks 👍 Also, based on the fact |
@frouioui can you provide the instructions for that? Or should we simply plan to do that manually for v20 before release? I suspect there may be other PRs which are missing website documentation as well. One example: #16021 EDIT: There's a Makefile target in the website repo to generate the docs. Do the following in a website branch, and make sure you have the main vitess repo checked out and accessible from there.
It becomes easier if doing after merge into main, because we can use |
Yeah exactly running |
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
EDIT: replied to wrong PR/browser tab 🤦 |
Signed-off-by: Tim Vaillancourt <[email protected]>
To address my own paranoia regarding this thread I added a go benchmark:
Where I think I'm most surprised by |
Re docs, good points. My suggestion: after code freeze, I'll generate |
queryLogSampleRate = 0 | ||
assert.False(t, shouldSampleQuery()) | ||
|
||
// for test coverage, can't test a random result |
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.
You can run 100 consecutive randoms and expect some to pass and some to fail. The false negative case for 1 in 2^100 is lower than any computational problem in modern hardware.
Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
* `vtgate`: support filtering tablets by tablet-tags (vitessio#15911) Signed-off-by: Tim Vaillancourt <[email protected]> Co-authored-by: Shlomi Noach <[email protected]> * Add support for sampling rate in `streamlog` (vitessio#15919) Signed-off-by: Tim Vaillancourt <[email protected]> * Fix merge conflict resolution Signed-off-by: Tim Vaillancourt <[email protected]> * update rand import Signed-off-by: Tim Vaillancourt <[email protected]> * Add sql text counts stats to `vtcombo`,`vtgate`+`vttablet` (vitessio#15897) Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> Co-authored-by: Harshit Gangal <[email protected]> Co-authored-by: Deepthi Sigireddi <[email protected]> * missing rename Signed-off-by: Tim Vaillancourt <[email protected]> * missing rename again Signed-off-by: Tim Vaillancourt <[email protected]> --------- Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> Co-authored-by: Shlomi Noach <[email protected]> Co-authored-by: Harshit Gangal <[email protected]> Co-authored-by: Deepthi Sigireddi <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
* `vtgate`: support filtering tablets by tablet-tags (vitessio#15911) Signed-off-by: Tim Vaillancourt <[email protected]> Co-authored-by: Shlomi Noach <[email protected]> * Add support for sampling rate in `streamlog` (vitessio#15919) Signed-off-by: Tim Vaillancourt <[email protected]> * Add sql text counts stats to `vtcombo`,`vtgate`+`vttablet` (vitessio#15897) Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> Co-authored-by: Harshit Gangal <[email protected]> Co-authored-by: Deepthi Sigireddi <[email protected]> --------- Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> Co-authored-by: Shlomi Noach <[email protected]> Co-authored-by: Harshit Gangal <[email protected]> Co-authored-by: Deepthi Sigireddi <[email protected]>
Description
This PR implements the RFC #15909 by adding a flag
--querylog-sample-rate float
tovtcombo
,vtgate
andvttablet
in order for queries to be sampled randomly without the need for the client to trigger query logging via a query directive/comment ==--querylog-filter-tag string
This flag supports values between
0.0
(no logging) and1.0
(log all queries) to match other0.0-1.0
float "sample" flagsmath/rand/v2
was used because it sounds betterRelated Issue(s)
Resolves #15909
Checklist
Deployment Notes