prometheus / prometheus/alertmanager

[feature request] matchers to work with annotations

Open
#3,957 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/enhancement
Dominant language
Go
Stars
8.6k
Forks
2.5k
Avg merge
2d 6h
Merged PRs (30d)
61

Description

What did you do?
In prometheus, labels have a very different semantics. For a given time series with label A,B,C with some values, any change to those values results in a completely different time series

For alerts, this is especially troublesome. Often, we use severity labels to denote the criticality of alerts. Changing these labels means that we lose continuity between the fired alerts vs the newly defined alert

This new alert goes through its own alert lifecycle in prometheus ( starts from pending -> fired ). This becomes a nuisance while configuring the alertmanager as previous alert with a different criticality ends up "resolved" giving misinformation about the ongoing problem

Annotations OTOH are orthogonal to labels. Changing them ensures continuity.

What did you expect to see?
Matchers that match against annotations. Severity then can be marked as an annotation rather than a label.

What did you see instead? Under which circumstances?
Matchers only work with labels

Environment
k8s

  • System information:

    insert output of uname -srm here

  • Alertmanager version:

0.24.0

  • Prometheus version:

2.49.1

  • Alertmanager configuration file:
na
  • Prometheus configuration file:
na
  • Logs:
na

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating Alertmanager's existing matcher handling and how alert labels and annotations are represented. Clarify the matching semantics and configuration surface for annotations, then define tests covering annotation matches and alert continuity; the issue does not identify specific files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.