Skip to content

Alertmanager's alertmanagerConfigMatcherStrategy issue #5038

@artemlive

Description

@artemlive

I've tested this PR, and there is another logical error.
When the config of the Alertmanager got generated, since we don't use the Alertmanager CRD, we built it with the defaults:

// TODO: Add an option to get an Alertmanager CRD through k8s informers.
cfgBuilder = alertmanager.NewConfigBuilder(slog.New(logging.NewSlogGoKitHandler(c.logger)), *version, store, &monitoringv1.Alertmanager{})
)

And it breaks the config, since it implicitly adds the

    matchers:
    - namespace="mimir"

to the main route:

...
 routes:
  - receiver: mimir/alertmanager-config/sre-alerts
    group_by:
    - alertname
    - cluster
    matchers:
    - namespace="mimir" #<---- the issue, since we care only about the alerts from the mimir ns
    continue: true
        routes:
          - receiver: mimir/alertmanager-config/other-alerts
            matchers:
            - cluster="staging"
            - project="project1"
            continue: false
            repeat_interval: 12h
...

Because we don't use the Alertmanager CRD, where we can set the alertmanagerConfigMatcherStrategy.

Originally posted by @artemlive in #5010 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions