prometheus / prometheus/alertmanager

Discord integration: no possibility to configure the webhook content object

Open
#3,667 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/enhancement
Dominant language
Go
Stars
8.6k
Forks
2.5k
Avg merge
2d 6h
Merged PRs (30d)
61

Description

Hi there,
According to the code of the Discord integration, there is no chance to specify Web hook content field from the message notification template. Just a embed title&message can be configured.
It's useful thing to have it when you want to tag person/role in alert. It can be doable in title&message of the embed message but user won't get a notification due to Discord API limitation.
So, it limit the tagging in Discord integration at all, and there is no chance with the current implementation to notify specific user about the alert.

What did you do?
Sent an alert to discord with the tagged user/role

What did you expect to see?
Tagged user should be notified in Discord client

What did you see instead? Under which circumstances?
Just an mention in alert without any notification for user in Discord client

  • Alertmanager version:

alertmanager, version 0.26.0 (branch: HEAD, revision: d7b4f0c7322e7151d6e3b1e31cbc15361e295d8d)
build user: root@df8d7debeef4
build date: 20230824-11:11:58
go version: go1.20.7
platform: linux/amd64
tags: netgo

  • Prometheus version:

prometheus, version 2.48.1 (branch: HEAD, revision: 63894216648f0d6be310c9d16fb48293c45c9310)
build user: root@71f108ff5632
build date: 20231208-23:33:22
go version: go1.21.5
platform: linux/amd64
tags: netgo,builtinassets,stringlabels

  • Alertmanager configuration file:
route:
  group_by: ['alertname', 'job']

  group_wait: 30s
  group_interval: 5m
  repeat_interval: 6h

  receiver: discord2

  routes:
      - matchers:
          - service="discord1"
        receiver: discord1
        group_interval: 12h
        repeat_interval: 24h


receivers:
- name: discord1
  discord_configs:
  - webhook_url: ''
    title: '{{ template "discord.default.title" . }}'
    message: '{{ template "discord.default.message" . }}'

- name: discord2
  discord_configs:
  - webhook_url: ''
    title: '{{ template "discord.default2.title" . }}'
    message: '{{ template "discord.default2.message" . }}'
    send_resolved: false


templates:
- '/etc/alertmanager/templates/default.tmpl'
  • Prometheus configuration file:
insert configuration here (if relevant to the issue)
  • Logs:
insert Prometheus and Alertmanager logs relevant to the issue here

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue concerns Alertmanager’s Discord integration, discord_configs, and notification templates; start by tracing how the title and message become the Discord webhook request. Define how a configurable content field should be supplied, then verify that a tagged user or role receives a Discord notification. No source file or test is named, so repository-wide search is needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.