prometheus / prometheus/alertmanager
Feature Req: Trigger alert if any of the match_re(or match) matches.
Nobody has claimed this yet.
- 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;
- 1st one has a
namespacelabel but doesn't team_tag label - 2nd one has a
team_taglabel but doesn't have anamespacelabel
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
- I can add two
receiverpointing 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. - I can maybe use
alert_relabel_configson the Prometheus side to inject dummy values either whennamespaceorteam_tagis 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
- 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.
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