Databases 6 min read

Configuring DBLE Alert Webhook for WeChat, DingTalk, FeiShu, and Custom URLs

This guide explains how to set up DBLE's alert webhook to send notifications to various platforms such as WeChat, DingTalk, FeiShu, or a custom URL, including download, installation, configuration file details, and example curl requests for seamless integration.

Aikesheng Open Source Community
Aikesheng Open Source Community
Aikesheng Open Source Community
Configuring DBLE Alert Webhook for WeChat, DingTalk, FeiShu, and Custom URLs

Background

Our company uses many DBLE instances to proxy numerous MySQL databases; to improve business stability we need immediate alert awareness, ensure each service’s status, and support routing different dbGroup instances to distinct alert robots.

Implementation Principle

Reference documentation: https://actiontech.github.io/dble-docs-cn/1.config_file/1.11_customized_alert.html

Alerts are delivered via DBLE callback events.

Usage

1. Download and Install

GitHub address: https://github.com/LuYongwang/dble-alram-webhook/releases

Download the JAR file and place it in the lib directory; the JAR has no third‑party dependencies and uses only DBLE’s existing libraries, ensuring no impact on DBLE stability.

2. Configuration

1) Configuration File Path

vim $DBLE_HOME/config/dble_alert.properties

2) Configuration File Details and Examples

Enterprise WeChat

# Fixed format
alert=io.github.luyongwang.dble.WebHookAlarmAlert
component_id=DBLE-10.0.142.11
web_hook.type=WORK_WECHAT
web_hook.robot_id=xxxx-xxxx-xxxx-xxxx-xxxxxx
web_hook.db_config.dbGroup1.principal=xxxxx,xxxxx
web_hook.db_config.dbGroup1.robot_id=xxxx-yyyy-zzzz-xxxx-yyyy

DingTalk

# Fixed format
alert=io.github.luyongwang.dble.WebHookAlarmAlert
component_id=DBLE-10.0.142.11
web_hook.type=DING_TALK
web_hook.robot_id=xxxxxxxxxxx
web_hook.db_config.dbGroup1.principal=150xxxxxxxx,132xxxxxxxx
web_hook.db_config.dbGroup1.robot_id=xxxxxxxxxxxxxxxxxxxxxxxxxxx

FeiShu

# Entry
alert=io.github.luyongwang.dble.WebHookAlarmAlert
component_id=DBLE-10.0.142.11
web_hook.type=FEI_SHU
web_hook.robot_id=xxxx-xxxx-xxxx-xxxx-xxxx
web_hook.db_config.dbGroup1.principal=xxxxxx,xxxxx
web_hook.db_config.dbGroup1.robot_id=xxxx-xxxxx-xxxx-xxxx-xxxx

Custom WebHook

# Entry
alert=io.github.luyongwang.dble.WebHookAlarmAlert
component_id=DBLE-10.0.142.11
web_hook.type=URL
web_hook.hook_url=http://xxxxxxxx/api/v1/robot/msg/send
web_hook.hook_params=robot_id=xxxx-xxxx-xxxx-xxxxxx
web_hook.db_config.dbGroup1.principal=150xxxxxx,132xxxxxx
web_hook.db_config.dbGroup1.hook_params=robot_id=xxx-xxx-xxxx-xxxx-xxxx

Custom WebHook Request Example (implement your own endpoint)

curl '{hook_url}?{hook_params}' \
   -H 'Content-Type: application/json' \
   -d '{
       "msgtype": "markdown",
       "markdown": {
           "content": "
DBLE alert message
:\n>Alert code:DBLE_HEARTBEAT_FAIL\n>Explanation: Heartbeat backend node failure\n>Level:WARN\n>Node:xxx\n>Time:2020-10-15 21:48:11\n>Details:|dbInstance:dbGroup1-instanceM1|"
       },
       "mobile_list": ["150xxxxxx","132xxxxxx"]
   }'

Effect Images

configurationFeishuWeChatwebhookdingtalkAlertDBLE
Aikesheng Open Source Community
Written by

Aikesheng Open Source Community

The Aikesheng Open Source Community provides stable, enterprise‑grade MySQL open‑source tools and services, releases a premium open‑source component each year (1024), and continuously operates and maintains them.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.