Skip to content

shanbay/prometheus-webhook-dingtalk

This branch is 11 commits ahead of, 92 commits behind timonwong/prometheus-webhook-dingtalk:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5be4bd1 · Nov 13, 2023
Dec 7, 2019
Jun 12, 2020
Jun 12, 2020
Dec 6, 2019
Jun 12, 2020
Dec 9, 2019
Dec 12, 2019
Dec 11, 2019
Dec 9, 2019
Dec 9, 2019
Jul 9, 2020
Dec 7, 2019
Nov 13, 2023
Dec 5, 2019
Dec 7, 2019
Dec 9, 2019
Dec 4, 2019
Nov 13, 2023
Dec 11, 2019
Dec 5, 2019
Dec 11, 2019
Jul 12, 2020
Jun 10, 2020
Dec 11, 2019
Jun 12, 2020
Dec 6, 2019
Dec 6, 2019

Repository files navigation

prometheus-webhook-dingtalk

Build Status Go Report Card Docker Pulls

Generating DingTalk notification from Prometheus AlertManager WebHooks.

Install

Precompiled binaries

Precompiled binaries for released versions are available in release page: It's always recommended to use latest stable version available.

Docker

You can deploy this tool using the Docker image from following registry:

Compiling the binary

Prerequisites

  1. Go (1.13 or greater is required)
  2. Nodejs
  3. Yarn

Build

Clone the repository and build manually:

make build

Usage

usage: prometheus-webhook-dingtalk [<flags>]

Flags:
  -h, --help                    Show context-sensitive help (also try --help-long and --help-man).
      --web.listen-address=:8060
                                The address to listen on for web interface.
      --web.enable-ui           Enable Web UI mounted on /ui path
      --web.enable-lifecycle    Enable reload via HTTP request.
      --config.file=config.yml  Path to the configuration file.
      --log.level=info          Only log messages with the given severity or above. One of: [debug, info, warn, error]
      --log.format=logfmt       Output format of log messages. One of: [logfmt, json]
      --version                 Show application version.

Configuration

常见问题可以看看 FAQ

## Request timeout
# timeout: 5s

## Customizable templates path
# templates:
#   - contrib/templates/legacy/template.tmpl

## You can also override default template using `default_message`
## The following example to use the 'legacy' template from v0.3.0
# default_message:
#   title: '{{ template "legacy.title" . }}'
#   text: '{{ template "legacy.content" . }}'

## Targets, previously was known as "profiles"
targets:
  webhook1:
    url: https://oapi.dingtalk.com/robot/send?access_token=xxxxxxxxxxxx
    # secret for signature
    secret: SEC000000000000000000000
  webhook2:
    url: https://oapi.dingtalk.com/robot/send?access_token=xxxxxxxxxxxx
  webhook_legacy:
    url: https://oapi.dingtalk.com/robot/send?access_token=xxxxxxxxxxxx
    # Customize template content
    message:
      # Use legacy template
      title: '{{ template "legacy.title" . }}'
      text: '{{ template "legacy.content" . }}'
  webhook_mention_all:
    url: https://oapi.dingtalk.com/robot/send?access_token=xxxxxxxxxxxx
    mention:
      all: true
  webhook_mention_users:
    url: https://oapi.dingtalk.com/robot/send?access_token=xxxxxxxxxxxx
    mention:
      mobiles: ['156xxxx8827', '189xxxx8325']

Packages

No packages published

Languages

  • Go 65.6%
  • TypeScript 27.4%
  • Makefile 3.0%
  • HTML 1.9%
  • CSS 1.7%
  • Shell 0.4%