Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Discord Intergration with AlertmanagerConfig CRD #5251

Closed
slashpai opened this issue Dec 26, 2022 · 6 comments · Fixed by #5671
Closed

Support Discord Intergration with AlertmanagerConfig CRD #5251

slashpai opened this issue Dec 26, 2022 · 6 comments · Fixed by #5671

Comments

@slashpai
Copy link
Contributor

What is missing?

Alertmanager version 0.25 is released with Discord integration. It would be nice to support that in prometheus-operator

prometheus/alertmanager#2948

Why do we need it?

Feature Parity

Environment

  • Prometheus Operator version:

    Insert image tag or Git SHA here

NA

Anything else we need to know?:

discord integration is not yet documented yet in alertmanager documentation but https://promlabs.com/blog/2022/12/23/sending-prometheus-alerts-to-discord-with-alertmanager-v0-25-0 gives overview on it

@simonpasquier simonpasquier changed the title Add Discord Intergration Support Discord Intergration with AlertmanagerConfig CRD Jan 4, 2023
@guitcastro
Copy link

Is there any workaround for now?

@simonpasquier
Copy link
Contributor

@guitcastro nope

@serejke
Copy link

serejke commented May 9, 2023

If you're using the community Helm charts, a workaround for now is to override alertmanager.config value. This allows to override raw Alertmanager configuration bypassing the AlertmanagerConfig CRD's schema validation.

Create a file prometheus-stack-values.yaml with the following content:

alertmanager:
  config:
    global:
      resolve_timeout: 5m
    inhibit_rules:
      - source_matchers:
          - 'severity = critical'
        target_matchers:
          - 'severity =~ warning|info'
        equal:
          - 'namespace'
          - 'alertname'
      - source_matchers:
          - 'severity = warning'
        target_matchers:
          - 'severity = info'
        equal:
          - 'namespace'
          - 'alertname'
      - source_matchers:
          - 'alertname = InfoInhibitor'
        target_matchers:
          - 'severity = info'
        equal:
          - 'namespace'
    route:
      group_by: [ 'alertname', 'job' ]
      group_wait: 30s
      group_interval: 5m
      repeat_interval: 12h
      receiver: discord
    receivers:
      - name: discord
        discord_configs:
          - webhook_url: 'https://discord.com/api/webhooks/<WEB_HOOK_TOKEN>'
      - name: 'null'
    templates:
      - '/etc/alertmanager/config/*.tmpl'

then in order to install the Helm chart:

helm install prometheus-stack prometheus-community/kube-prometheus-stack --namespace monitoring --values .config/prometheus-stack-values.yaml

@guitcastro
Copy link

I actually workaround this using a secret named {{alertmanager-CRD-name}}-alertmanager with a raw alertmanager config yaml and it worked.

@Azanul
Copy link
Contributor

Azanul commented Jun 13, 2023

May I implement this?

@xiu
Copy link
Contributor

xiu commented Jun 13, 2023

@Azanul go for it! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants