Uploaded image for project: 'Observability UI'
  1. Observability UI
  2. OU-1001

AlertmanagerConfig automatically injects namespace in matchers section of the config

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • COO 1.2.1
    • coo
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • Moderate
    • None
    • None
    • None
    • None
    • None
    • None

      After creating AlertmanagerConfig provided by monitoring.rhobs API, then config which is generated already has a matchers pointing to the namespace in which AlertmanagerConfig was created. 

      AlertmanagerConfig
      =====
      apiVersion: monitoring.rhobs/v1alpha1
      kind: AlertmanagerConfig
      metadata:
        labels:
          mso: example
        name: example
        namespace: openshift-cluster-observability-operator
      spec:
        receivers:
          - name: abc
            webhookConfigs:
              - url: 'http://abc.example.com'
        route:
          continue: true
          groupBy:
            - alertname
          matchers:
            - matchType: '='
              name: alertname
              regex: false
              value: Watchdog
          receiver: abc 
      Config injected in associated secret:
      ======
      matchers: 
        - alertname="Watchdog"
        - namespace="openshift-cluster-observability-operator"   // This was not defined in PrometheusRule
      

      Because of this, it is mandatory to define a label for namespace in the associated PrometheusRule config.

      Components:
      Cluster Observability Operator

      How Reproducible:
      100%

      Steps to Reproduce:
      1. Create MonitoringStack with AlertmanagerConfig enabled.
      2. Create AlertmanagerConfig to route the alerts.
      3. Create a test alert (without defining namespace label)
      4. Now, check the alertmanager config generated by it

              Unassigned Unassigned
              rhn-support-dgautam Dhruv Gautam
              None
              None
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: