Uploaded image for project: 'Couchbase Monitoring and Observability Stack'
  1. Couchbase Monitoring and Observability Stack
  2. CMOS-72

Allow completely disabling a Prometheus rule

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • 1.0
    • None
    • cmos
    • None

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Unassigned Unassigned
              marks.polakovs Marks Polakovs (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty