RFC: support sampling rate for querylog
#15909
Labels
Component: Observability
Pull requests that touch tracing/metrics/monitoring
Type: RFC
Request For Comment
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: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
andvttablet
) such as--querylog-sample-rate 0.0
or--querylog-sampling-rate 0.0
to specify a ratevtgate
/vttablet
should log queries toquerylog
, 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 setThis would provide:
querylog
from the Vitess-sideUse Case(s)
querylog
samples without having to make client-side changes to the--querylog-filter-tag
The text was updated successfully, but these errors were encountered: