prometheus / prometheus/prometheus
promtool: Allow inexact matches in exp_alerts
@Aurifi is already working on this.
Since Jun 20, 2024.
- Dominant language
- Go
- Stars
- 66.1k
- Forks
- 10.8k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 131
Description
Proposal
Use case. Why is this important?
Currently, when building a rule test, one needs the exp_alerts to be exact matches of the alert that would fire, with all labels and annotations. Since these can be fairly rich in real-world usage, I propose that matching can be "inexact". Rather than all labels and annotations being exact matches, only those actually present in the exp_labels and exp_annotations must match.
I frequently come across organisations where entire runbooks are written in annotations, and duplicating those into each rule adds a lot of friction to test adoption. Fixing a typo in the runbook breaking unit tests, for example.
This could be made opt-in with a matching_mode or such, if there is a frequent desire to match all the things.
Alternatively, or perhap as a complement, being able to check for presence but ignoring content. This could facilitate something like a test that validates that all alerting rules have a runbook, for example.
Contributor guide
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.