Skip to content

add receiver matchers to silence proto#5292

Open
Spaceman1701 wants to merge 2 commits into
prometheus:mainfrom
Spaceman1701:receiver-matcher-proto
Open

add receiver matchers to silence proto#5292
Spaceman1701 wants to merge 2 commits into
prometheus:mainfrom
Spaceman1701:receiver-matcher-proto

Conversation

@Spaceman1701

@Spaceman1701 Spaceman1701 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

This change adds a new receiver_matcher_sets field to the silence.proto. This is the first real step towards implementing #4962. I will make this will be pretty far reaching and complex.

For now, this change is pretty straightforward. The only decisions it makes are:

  1. receiver_matchers_sets can support multiple matcher sets, just like alert matchers
  2. Silence with no receiver matchers behave identically to silences created before receiver matchers. This is essential for backwards compatibility and it also ensures silences that don't use the feature continue to do the right thing
  3. the matcher sets are independent - this avoids having to add a new type which contains both alert and receiver of matchers. It does somewhat limit the types of silences that can be created, but I think it's worth it to keep things simple. A silence with match an alert if at least one set of alert matchers and at least one set of receiver matchers apply.

Nothing reads or writes the new field, and it will always be optional. I believe it's completely safe to add it now.

Which user-facing changes does this PR introduce?

None

Summary by CodeRabbit

  • New Features
    • Silence configurations now support OR-based receiver label matching via receiver matcher sets, allowing more flexible matching of receivers.
    • Documentation clarifies these matchers apply to receiver labels (not alert labels).
    • If no receiver matcher sets are provided, the system defaults to matching all receivers for backward compatibility.

Signed-off-by: Ethan Hunter <fc.spaceman@gmail.com>
@Spaceman1701 Spaceman1701 requested a review from a team as a code owner June 5, 2026 19:08
@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Too much diff to scan? Review this PR in Change Stack to start with the highest-impact changes.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a23629ba-13e7-4ae9-b960-573be8a6c4ff

📥 Commits

Reviewing files that changed from the base of the PR and between 6fe1b47 and 4958a0d.

📒 Files selected for processing (1)
  • silence/silencepb/silence.proto

📝 Walkthrough

Walkthrough

The PR adds a receiver_matcher_sets field to the Silence protobuf message, enabling OR-based matching of receiver labels. The field defaults to matching all receivers when not specified.

Changes

Receiver matcher sets field

Layer / File(s) Summary
Receiver matcher sets field
silence/silencepb/silence.proto
Silence message extended with receiver_matcher_sets field (tag 12) supporting repeated MatcherSet for OR-based receiver-label matching, with documented default-all-receivers behavior when empty.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

  • #4962: Both changes add receiver-targeted matching fields to the Silence data model to restrict silences by receiver labels.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description provides comprehensive context including the issue reference, design decisions, and backwards compatibility considerations. However, it lacks the required area prefix format ('area: short description') specified in the template, and the release-notes section is marked as 'None' without following the specified format. Format the title as 'silences: add receiver matchers to silence proto' to match the 'area: short description' convention, and clarify the release-notes section format per template guidelines.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'add receiver matchers to silence proto' clearly and specifically describes the main change: adding receiver matchers to the silence protocol buffer file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@silence/silencepb/silence.proto`:
- Around line 71-76: Update the comment for the field `repeated MatcherSet
receiver_matcher_sets = 12;` to fix typos: change "recievers" to "receivers" and
make "alert label matcher" plural ("alert label matchers"); ensure the full
sentence now reads something like "Receiver matchers apply to the labels of
receivers, not alerts. At least one set of receiver matchers must match..." so
generated docs use the corrected spelling and pluralization for
`MatcherSet`/`receiver_matcher_sets`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 32db1854-01b9-4070-a5c7-12d970ac9be5

📥 Commits

Reviewing files that changed from the base of the PR and between d51d792 and 6fe1b47.

⛔ Files ignored due to path filters (1)
  • silence/silencepb/silence.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (1)
  • silence/silencepb/silence.proto

Comment thread silence/silencepb/silence.proto
Signed-off-by: Ethan Hunter <fc.spaceman@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant