Skip to content

Feature Request: Configurable query-shape ignore-list for vtgate query log #20173

@ChaitanyaD48

Description

@ChaitanyaD48

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:

  1. Try to normalize the incoming query via sqlparser.RedactSQLQuery.
    • On success, look up the normalized form in the ignore set.
  2. 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

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions