Alarm callback
Alarm callback
Alarm callbacks allow you to send alarm notifications to a specified URL, enabling flexible handling of various alert messages. BLS utilizes BCM notification templates, where you can configure the alarm callback address in BCM to receive notifications via office tools like WeCom, DingTalk, Infoflow, Feishu, Zhiyinlou, and KNOCK. Refer to the webhook usage guide for more details. It also supports custom callback URLs and message delivery to publicly accessible URLs via HTTP/HTTPS POST requests, allowing further processing of alarm information via the callback API.
Instructions for use of alarm callback
- Alarm callback API: You need to provide a publicly accessible URL address capable of receiving POST requests through the HTTP/HTTPS protocol as the callback address.
- Alarm callback triggers: If an alarm callback address is specified, the triggering logic is the same as for SMS, email, and call-based alarms. When an alarm strategy is activated or resolved, alert messages will be sent through the callback API.
- Bind the alarm callback API: You can add a callback API while creating an alert strategy. An alert strategy can be linked to only one alarm callback URL.
- Response content: After sending alarm information to the bound URL, we need to receive a response content (httpCode = 200) indicating successful receipt; otherwise, we will resend the alert information three times at most, with a timeout duration of 5 s (retry mechanism)
Alarm callback operation steps
- On the Baidu Cloud Monitor (BCM) platform, go to
-> in the left navigation bar, and click .

- In the Add Notification Template page, input a publicly accessible URL into the API callback field.

- On the Baidu Log Service (BLS) platform, click
-> to select an alarm notification template with an alarm callback address

Instructions for use of webhook
- WeCom
- Log in to WeCom, open the designated WeCom group that will receive alarm notifications.
- After adding a group bot, copy the webhook address and paste it into Alarm Callback as instructed in the steps above.
- Once successfully configured, any triggered alarm notification will be sent to the WeCom group.
- DingTalk
- Log in to DingTalk, open the DingTalk group designated to receive alarm notifications, and add a group bot.
- Complete the form, select the Custom Keywords option in the Security Settings section, and it is recommended to set Alarm as the keyword.
Note: Check the custom keywords box, enter up to 10 keywords, and ensure each message contains at least one keyword for successful delivery. For instance, if Alarm is set as a custom keyword, messages sent by the bot must include the word Alarm to guarantee successful delivery.
- After adding a DingTalk bot, copy the webhook address and input it into Alarm Callback by following the stated steps.
- Once configured successfully, any triggered alarm notification will be delivered to the DingTalk group.
- Infoflow
- Log in to Infoflow, open the Infoflow group designated to receive alarm notifications.
- After adding an Infoflow bot, copy the webhook address and paste it into Alarm Callback following the provided steps.
- Once successfully configured, any triggered alarm notification will be sent to the Infoflow group.
- Zhiyinlou
- Sign in to Zhiyinlou, open the Zhiyinlou group that needs to receive alarm notifications.
- Complete the form, select the Custom Keywords option in the Security Settings section, and it is recommended to set Alarm as the keyword.
Note: Select the Custom Keywords checkbox, enter up to ten keywords, and ensure that messages include at least one keyword to be successfully sent. For instance, if "Alarm" is added as a keyword, messages sent by this bot must contain the word "Alarm" to be successfully delivered.
- After adding an Infoflow bot, copy the webhook address and paste it into Alarm Callback following the provided steps.
- Once successfully configured, any triggered alarm notification will be sent to the Infoflow group.
- Feishu
- Log in to Feishu, open the Feishu group that will receive alarm notifications.
- After adding an Infoflow bot, copy the webhook address and paste it into Alarm Callback following the provided steps.
- Once successfully configured, any triggered alarm notification will be sent to the Infoflow group.
- Knock
- Log in to Knock, open the Knock group that will receive alarm notifications.
- After adding an Infoflow bot, copy the webhook address and paste it into Alarm Callback following the provided steps.
- Once successfully configured, any triggered alarm notification will be sent to the Infoflow group.
POST method parameter description
Log alarm POST method parameter description
| Parameters | Description |
|---|---|
| alertId | Alarm ID |
| userId | Account ID |
| policyName | Alarm strategy name |
| triggerTimestamp | Alarm timestamp |
| region | Region where the alarm object is located |
| objects | Object triggering the alarm, including project logs, logStoreName, and logStoreId |
| alarmLevel | Alarm level status. Based on actual conditions, return one of the four statuses: critical, notification, important, or warning. |
| alarmStauts | Alarm status: one of alarm, recovered, or repeated alarm |
| triggerCondition | Trigger conditions |
| currentValue | Current value of the metric when an alarm occurs or is restored |
| targetSQL | Execution statement that triggers an alarm |
| rawLogs | Original log |
