prometheus / prometheus/alertmanager

Alert manager SNS receiver have option to publish message with json format

Open
#2,678 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

A lot of use-case for SNS is to use lambda to post process message and publish to slack etc..
It will be helpful if we can have an option to enable the web-hook similar json format for SNS messages so that post-processing will be easier
webhook: https://prometheus.io/docs/alerting/latest/configuration/#webhook_config

It will also helpful to keep the customizable template like non-webhook receivers so that if user is using SNS supported direct destination as email and phone text messages, users can still customized something formatted with way they want without post-processing.

The best way to do it might be we have a flag in the sns_configs to enable/disable json format to have users define which way they like(json or template formatted)

  • Alertmanager configuration file:
alertmanager_config: |
  global:
    resolve_timeout: 5s
  route:
    receiver: example-sns
    group_interval: 1m
    group_by: [cluster, alertname]
  receivers:
    - name: example-sns
      sns_configs:
      - api_url: https://sns.us-west-2.amazonaws.com
        topic_arn: arn:aws:sns:us-west-2:xxx:My-Topic
        attributes:
          key: severity
          value: SEV2
  inhibit_rules:
    - source_match:
        severity: 'critical'
      target_match:
        severity: 'warning'
      equal: ['low_connected_users']

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

Start by locating the sns_configs entry in Alertmanager’s configuration and compare the expected SNS payload with the webhook_config documentation linked in the issue. Review the existing SNS receiver behavior and its customizable template support; done means the JSON-versus-template choice is defined for the shown configuration and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go
Domain
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.