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.
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.properties2) 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-yyyyDingTalk
# 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=xxxxxxxxxxxxxxxxxxxxxxxxxxxFeiShu
# 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-xxxxCustom 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-xxxxCustom 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
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.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.