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

RFC: support sampling rate for querylog #15909

Open
timvaillancourt opened this issue May 9, 2024 · 0 comments · May be fixed by #15919
Open

RFC: support sampling rate for querylog #15909

timvaillancourt opened this issue May 9, 2024 · 0 comments · May be fixed by #15919
Assignees
Labels
Component: Observability Pull requests that touch tracing/metrics/monitoring Type: RFC Request For Comment

Comments

@timvaillancourt
Copy link
Contributor

timvaillancourt commented May 9, 2024

The querylog feature can generate a lot of logs. Today, my understanding is the only knob to control how often a query is logged is this flag:

--querylog-filter-tag string string that must be present in the query for it to be logged; if using a value as the tag, you need to disable query normalization

This means a user that wants to log X % of query traffic needs to handle the sampling rate from the client side, by adding a filter tag to X % of queries

In practice this can mean a team supporting Vitess in production may need to ask an application team to change configs/code, just to modify the sampling rate of queries. Finally, what if an app doesn't/forgets-to set the filter tag? This would mean no samples for some use cases

This RFC proposes a new querylog flag (vtgate and vttablet) such as --querylog-sample-rate 0.0 or --querylog-sampling-rate 0.0 to specify a rate vtgate/vttablet should log queries to querylog, regardless of if the --querylog-filter-tag was provided in the query. This would work in addition to the --querylog-filter-tag functionality, ie: queries with X tag are still logged if both flags are set

This would provide:

  1. Full control of the sampling rate of querylog from the Vitess-side
  2. More certainty the querylog contains all workloads (not just workloads adding a filter tag)

Use Case(s)

  • A Vitess user that would like to capture a sample of all workloads hitting vtgate/vttablet
  • A Vitess user that would like to adjust the rate of querylog samples without having to make client-side changes to the --querylog-filter-tag
@timvaillancourt timvaillancourt added Type: Feature Request Needs Triage This issue needs to be correctly labelled and triaged labels May 9, 2024
@timvaillancourt timvaillancourt changed the title RFC: support sampling rate for querylog RFC: support sampling rate for querylog May 9, 2024
@timvaillancourt timvaillancourt self-assigned this May 9, 2024
@timvaillancourt timvaillancourt linked a pull request May 11, 2024 that will close this issue
5 tasks
@frouioui frouioui added Component: Observability Pull requests that touch tracing/metrics/monitoring and removed Needs Triage This issue needs to be correctly labelled and triaged labels May 13, 2024
@timvaillancourt timvaillancourt added Type: RFC Request For Comment and removed Type: Feature Request labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Observability Pull requests that touch tracing/metrics/monitoring Type: RFC Request For Comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants