prometheus / prometheus/alertmanager
API v3alpha: SilenceService
@siavashs is already working on this.
Since Aug 29, 2026.
- Dominant language
- Go
- Stars
- 8.6k
- Forks
- 2.5k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 61
Description
Parent: #5450
Summary
Define and implement the complete silence.v3alpha.SilenceService for unary CRUD/list operations and stored-mutation watches.
The public proto should be reviewed first. Implementation may then land in phases, with v2-incompatible writes protected by a narrowly scoped capability flag.
Proto PR
Define:
Silence,SilenceStatus, andGettableSilence.- Matcher-set, annotation, state-filter, pagination, validation, and required-feature fields using
common.v3alpha. - Create, Update, Get, List, Delete/Expire, and
WatchSilencesRPCs. - Stored-mutation events and snapshot-complete messages.
Represent multiple alert matcher sets directly. Do not expose receiver matcher sets as functional public fields until validation, matching, history comparison, v2 conversion, and runtime silencing implement them consistently.
Document replacement IDs, explicit expiration, live-view pagination, current-state calculation, feature gating, and node-local watch cursors.
Implementation phases
Unary CRUD and listing
- Convert directly between the public proto and
silencepb; do not reuse the v2 converter, which cannot represent multiple matcher sets. - Split create and update semantics at the RPC boundary while preserving store behavior where history-changing updates expire the old ID and create a replacement ID.
- Return the resulting ID explicitly.
- Validate matcher sets, timestamps, IDs, and annotations before calling the store.
- Map missing IDs to
NotFound, invalid definitions toInvalidArgument, limits toResourceExhausted, disabled capabilities toFailedPrecondition, and unexpected failures toInternal. - Implement definition and state filters, deterministic state/time/ID ordering, and shared pagination.
- Resolve the exact-
ends_atboundary mismatch betweenCurrentStateand internal query behavior.
Multi-matcher-set capability
Add a disabled-by-default --enable-feature capability flag for creating or updating silences with multiple matcher sets.
When disabled:
- Compatible single-set CRUD/list operations remain available.
- Multi-set writes return
FailedPreconditionwith structured details naming the required feature. - Requests are not flattened or silently reinterpreted.
When enabled:
- Accept multi-set resources while API v2 remains mounted.
- Document and test that API v2 cannot faithfully represent these resources and may fail to read them.
WatchSilences
Emit an initial snapshot and snapshot-complete marker followed by stored created, updated, explicitly expired, replaced, HA-merged, and purged mutations.
Do not emit timer-driven activation or expiration events. Clients derive state from starts_at/ends_at and reconnect when they need a new computed snapshot.
Apply definition/state filters to snapshots and before/after mutations. Define read/watch behavior for already stored or HA-merged multi-set resources independently from the write capability gate.
Acceptance criteria
- The
silence.v3alphaproto and generated code land before handler implementation. - Unary operations convert directly to/from internal silence protobufs.
- Create/update replacement and resulting-ID semantics are explicit.
- Filtering, state boundaries, ordering, and pagination are deterministic.
- Multi-set writes are disabled by default and return structured
FailedPreconditiondetails. - Enabling multi-set writes does not disable v2, and the v2 limitation is documented and tested.
- WatchSilences covers local, HA, replacement, explicit expiry, and GC mutations with overflow/resnapshot semantics.
- Ginkgo/Gomega coverage includes CRUD, feature states, annotations, OR matcher sets, HA reads, watches, transports, and route prefixes.
Dependencies and related work
- Shared contracts and capability infrastructure: #5479.
- Connect request, stream, and observability hardening: #5478.
- Stored-mutation broker and silence feed: #5480.
- Internal multi-matcher silence model: #4946.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.