prometheus / prometheus/alertmanager

Feature Req: Trigger alert if any of the match_re(or match) matches.

Open
#2,629 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Alertmanager > routes > match_re > CAN we Trigger Alert if ANY match_re condition matches?

I have two kinds of alerts;

  1. 1st one has a namespace label but doesn't team_tag label
  2. 2nd one has a team_tag label but doesn't have a namespace label

I want to catch both kinds of alerts in ONE receiver. The below route is just for one team like this we have N teams.

routes:
- receiver: 'devops-critical'
  match:
    severity: 'critical'
  match_re:
    # ---> WANT TO TRIGGER ALERT IF namespace OR team_tag regex matches
    namespace: '(ingress-nginx|istio-.*|keda|kube-.*|logging|loki|)'
    team_tag: '(devops-tools)'

Thought possible solutions

  1. I can add two receiver pointing to same the same endpoint(slack channel/teams/email...) and use them to check separately once for namespace and once for team_tag. But this will result in duplication.
  2. I can maybe use alert_relabel_configs on the Prometheus side to inject dummy values either when namespace or team_tag is missing and append that dummy value to in above regex. But this will increase complexity on others SREs.

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 with Alertmanager route matching and the routes, match, and match_re configuration described in the issue. Determine how matching currently combines multiple match_re labels, then define tests showing that namespace OR team_tag can select one receiver without duplicate notifications. Done means the behavior and configuration semantics are covered by tests and documented.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.