Skip to content

Implement metrics blocklisting in thanos with negation pattern support#314

Open
willh-db wants to merge 4 commits intodatabricks:db_mainfrom
willh-db:metric-blocklisting
Open

Implement metrics blocklisting in thanos with negation pattern support#314
willh-db wants to merge 4 commits intodatabricks:db_mainfrom
willh-db:metric-blocklisting

Conversation

@willh-db
Copy link
Collaborator

Changes

  • Adds a blocklist filter to the receive path that drops time series matching configurable M3-style filter rules (exact, wildcard, negation, alternation) before writing
  • Rules are defined as a YAML list of filter strings via --receive.blocklist-config-file and applied before relabeling
  • Supports optional hot-reload via --receive.blocklist-config-reload-timer for emergency blocking without restarts
  • Exposes metrics: blocklist_dropped_series_total, blocklist_active_rules, blocklist_config_reload_total, blocklist_config_reload_err_total

Verification

  • Unit tests for config parsing (empty, single, multiple rules, invalid input)
  • Unit tests for filtering (exact match, wildcard, negation, alternation, multi-rule, all-blocked, none-blocked, nil filter)
  • Hot-reload tests (valid update, invalid config preserves old rules)
  • Integration tests in handler_test.go validating end-to-end blocklist behavior

@willh-db willh-db changed the title Implement metrics blocklisting in pantheon-writer with negation pattern support Implement metrics blocklisting in thanos with negation pattern support Mar 20, 2026
Copy link
Collaborator

@yuchen-db yuchen-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like some irrelevant commits are included. do you mind rebasing on latest db_main?

@willh-db willh-db force-pushed the metric-blocklisting branch from 351c9fd to d6a5398 Compare March 21, 2026 00:34
@willh-db willh-db requested a review from yuchen-db March 21, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants