Feature Description
Proposal
Introduce a Viper-managed config option on vtgate that lets operators specify a list of SQL query shapes to elide from the vtgate query log. Users opt in explicitly.
Matching semantics
Match against the normalized query shape, i.e. the output of sqlparser.RedactSQLQuery where literal values are replaced with placeholders (e.g. select :vtg1).
For Queries which does not parse and RedactSQLQuery will fail on it like select $$. The ignore-list lookup therefore needs a two-tier strategy:
- Try to normalize the incoming query via
sqlparser.RedactSQLQuery.
- On success, look up the normalized form in the ignore set.
- On parse failure, fall back to a raw-string match (case-insensitive, leading/trailing whitespace stripped) against the ignore set.
Configuration shape
A Viper-bound flag, something along the lines of: --query-log-ignore-patterns="select $$,select :vtg1 from dual,..." or accepting a file path for larger lists. Empty by default.
Related
Use Case(s)
One of the Use case is mentioned in Related issue: #19610
Feature Description
Proposal
Introduce a Viper-managed config option on
vtgatethat lets operators specify a list of SQL query shapes to elide from the vtgate query log. Users opt in explicitly.Matching semantics
Match against the normalized query shape, i.e. the output of
sqlparser.RedactSQLQuerywhere literal values are replaced with placeholders (e.g.select :vtg1).For Queries which does not parse and
RedactSQLQuerywill fail on it likeselect $$. The ignore-list lookup therefore needs a two-tier strategy:sqlparser.RedactSQLQuery.Configuration shape
A Viper-bound flag, something along the lines of:
--query-log-ignore-patterns="select $$,select :vtg1 from dual,..."or accepting a file path for larger lists. Empty by default.Related
select $$in querylog #20073select $$in querylog #20073 (comment)Use Case(s)
One of the Use case is mentioned in Related issue: #19610