Description
Currently, while you can partially disable prom rules with the alert overrider, you cannot completely disable them. For example, currently it's possible to do something like
groups:
|
- name: rules
|
rules:
|
- alert: test
|
expr: foo{}
|
- alert: testDisable
|
override: [test]
|
expr: foo{bar="baz"} |
enabled: false |
and you'll get one rule with {{foo
{bar!="baz"}}}.
But I'd like to be able to write something like
groups:
|
- name: rules
|
rules:
|
- alert: test
|
expr: foo{}
|
- alert: testDisable
|
override: [test]
|
enabled: false |
and have the rule be removed from the output completely. Currently running alert-overrider on this panics:
panic: runtime error: index out of range [0] with length 0 |
|
goroutine 1 [running]: |
main.extractFilterExpressions({0x0, 0x0}) |
/Users/marks.polakovs@couchbase.com/code/prometheus-alert-overrider/main.go:96 +0x68 |
main.NegateFilterExpression({0x0, 0x1114385}) |
/Users/marks.polakovs@couchbase.com/code/prometheus-alert-overrider/main.go:121 +0x25 |
main.AlertFile.Override({{0xc000098840, 0xc0000c5f70, 0x10405f1}}, {{0xc0000b0600, 0xb}, {0x0, 0x0}, {0x0, 0x0}, {0x0, ...}, ...}) |
/Users/marks.polakovs@couchbase.com/code/prometheus-alert-overrider/main.go:70 +0x19f |
main.main()
|
/Users/marks.polakovs@couchbase.com/code/prometheus-alert-overrider/main.go:201 +0x385 |
I've raised an upstream issue; once this is resolved it should be case of upgrading the alert-overrider version and adding tests to cover this.
Attachments
Issue Links
- depends on
-
CMOS-46 Update CMOS to use the alert-overrider approach
- Done
- links to