Skip to content
This repository was archived by the owner on Jun 19, 2026. It is now read-only.

[ENGMP-365] Add protection triggered counter metric and log action logging#320

Open
yishi3-db wants to merge 4 commits into
yi-shi_data/yishi3-db/query-protection-roundtripfrom
yi-shi_data/yishi3-db/query-protection-metric
Open

[ENGMP-365] Add protection triggered counter metric and log action logging#320
yishi3-db wants to merge 4 commits into
yi-shi_data/yishi3-db/query-protection-roundtripfrom
yi-shi_data/yishi3-db/query-protection-metric

Conversation

@yishi3-db

@yishi3-db yishi3-db commented Mar 20, 2026

Copy link
Copy Markdown

What did you change, and why?

  • Extracted rule action handling into applyProtectionResult() to make it extensible for future actions
  • Added log action: logs a message when a protection rule triggers
  • Added thanos_query_frontend_protection_triggered_total counter metric with labels action (block/log) and rule (rule name)
  • Changed block action response code from 400 to 403 to better reflect "query explicitly forbidden" semantics

How do you know it works?

Verified in dev-aws-us-east-1-obs-integrationtest:

  • block action returns 403 and increments the counter
  • log action logs the message and increments the counter

@yishi3-db yishi3-db changed the title Yi shi data/yishi3 db/query protection metric [ENGMP-365] Add protection triggered counter metric and log action logging Mar 20, 2026
@yishi3-db yishi3-db marked this pull request as ready for review March 20, 2026 22:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant