Skip to content

Add fault header inequality matchers#718

Merged
shashankv02 merged 1 commit into
masterfrom
fault-inequality-matchers-v0
Jul 6, 2026
Merged

Add fault header inequality matchers#718
shashankv02 merged 1 commit into
masterfrom
fault-inequality-matchers-v0

Conversation

@shashankv02

@shashankv02 shashankv02 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

💸 TL;DR

Port of https://github.snooguts.net/reddit-go/faultbp/pull/30

Adds inequality matching for fault selectors so operators can fault broad request sets while excluding known-safe dependencies without introducing a grouping syntax.

The matcher keys a, h, and m now accept != in addition to =. Multiple matcher segments in a single config are ANDed, so an exclusion list can be written as repeated address inequalities.

📜 Details

Syntax

<matchers>;<actions>
  • Matcher keys: a=, a!=, h=, h!=, m=, m!=.
  • A config still needs at least one a matcher to match a request.
  • Multiple matchers in one config are ANDed.
  • Action keys are unchanged: d, D, f, b, F.
  • Multiple configs are still comma-separated and evaluated first-match-wins.

Examples

# Fault every outgoing request with 500 except critical-service, deciderpb.Decider,
# and foo.bar's Healthcheck method.
x-bp-fault: a!=critical-service;a!=deciderpb.Decider;a!=foo.bar;f=500,a=foo.bar;m!=Healthcheck;f=500

# Fault every method on foo.bar except Healthcheck.
x-bp-fault: a=foo.bar;m!=Healthcheck;f=500

🧪 Testing Steps / Validation

Added Unit tests

✅ Checks

  • CI tests (if present) are passing
  • Adheres to code style for repo
  • Contributor License Agreement (CLA) completed if not a Reddit employee

@shashankv02
shashankv02 marked this pull request as ready for review July 6, 2026 18:01
@shashankv02
shashankv02 requested a review from a team as a code owner July 6, 2026 18:01
@shashankv02
shashankv02 requested review from HiramSilvey, konradreiche, mathyourlife-reddit and pacejackson and removed request for a team July 6, 2026 18:01
@shashankv02
shashankv02 force-pushed the fault-inequality-matchers-v0 branch from f860fdc to 06509fb Compare July 6, 2026 18:03
@shashankv02
shashankv02 merged commit e07b58e into master Jul 6, 2026
2 checks passed
@shashankv02
shashankv02 deleted the fault-inequality-matchers-v0 branch July 6, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants