Skip to main content
Generate a unique Dingtalk robot address in Flashduty, and synchronize the occurrence and recovery of alerts through Dingtalk.

Operation steps

Create DingTalk Bot Compatible integration

You can obtain a DingTalk Bot Compatible integration address through either of these two methods:

Use a dedicated integration

Choose this option if all alerts go to one channel. It’s the simpler setup.
  1. In the Flashduty console, select Channel and open a channel
  2. Select Configuration → Integrations → Private integration, then click Add integration
  3. Choose DingTalk Bot Compatible integration and click Save to generate a card
  4. Click the generated card to view the DingTalk Bot Compatible Integration URL, copy it for later use, and you’re done

Use a shared integration

Choose this option if you need to route alerts to different channels based on the alert payload.
  1. In the Flashduty console, go to Integration Center → Alert Events
  2. Select DingTalk Bot Compatible integration:
    • Integration Name: Define a name for the current integration
    • Message Type: Select Dingtalk alert message type, currently only Text and Markdown are supported
    • Push Mode: Choose when to trigger or recover alerts for Dingtalk notifications
  3. Copy the DingTalk Bot Compatible Integration URL for later use
  4. Configure the default route and select the corresponding channel (after integration creation, you can go to Routes to configure more routing rules)

Configure the DingTalk Bot Compatible integration

1

Choose the message type and push mode in Flashduty

Where: Flashduty › Integration Center › Alert events › DingTalk Bot Compatible › Alert push settingsWith message type Text, the alert title is always “钉钉告警”, so Trigger or update alert based on message title isn’t offered, and rules can only extract the Alert Key from Message content.Click Save and copy the Push URL.
2

Replace the DingTalk custom robot webhook URL with the push URL in the sender

Where: the webhook settings of the DingTalk custom robot notification in the sending tool (menus vary by tool)
3

Send a test message from the sender and confirm

Where: the test option of that webhook notification in the sending tool (if there’s no test option, wait for a real alert)After a few seconds, the integration in Flashduty shows a Latest event time, which means the setup works. If it doesn’t, check that the message type is supported (see “Notes” below).

Push modes and rules

With Trigger or close alert based on rules:
  • At least one trigger rule is required.
  • Close rules are checked before trigger rules; within each type, rules are checked in the configured order, and the first match wins.
  • Every rule needs an Alert Key regex. The system uses the Alert Key to find the open alert to update or close. The regex must be a valid RE2 expression; it is validated on save, and an invalid expression is rejected with the message “Please enter valid regex”.
  • The Alert Key is built from the regex capture groups, joined with ,. If the regex captures nothing, the system builds the Alert Key from the message title, so a bad rule doesn’t lose alerts.
  • Default rules: if none of the rules above match, create new alert (Alert Key built from the message title) or discard message.
Example:
  • Rule 1: close, condition “Message content matches /RESOLVED/”
  • Rule 2: trigger, condition “Message content matches /PROBLEM/”
  • Both rules extract the Alert Key from Message content with the regex:
The messages PROBLEM: web-01 disk usage 93% and RESOLVED: web-01 disk usage 71% both capture web-01 disk, so they get the same Alert Key and the recovery message closes the alert. The regex has no ^, because other text may come before it in the message content.

Why /(.*)/ can’t be used as the Alert Key regex

/(.*)/ captures the whole content. Trigger and recovery messages have different content and so get different Alert Keys; the recovery message finds no matching alert, and the alert is never closed. Capture only the part that identifies the problem, such as the host and check in the example above.

No-event detection

No-event detection works for push alert integrations, except HTTP Pull and DB Pull: when an integration receives no valid event for the detection period, it creates a Warning alert. The switch is off by default and the detection period defaults to 10 minutes. See Alert integrations overview.

Notes

  • The DingTalk Bot Compatible integration only accepts text and markdown messages; other message types can’t be received.
  • For text messages, the alert title is “钉钉告警”; Markdown messages use their own title. To change the title, use the alert pipeline.

Status and severity

Alerts pushed to Flashduty through the DingTalk Bot Compatible integration always have Warning severity. To set the severity from the message content, add rules on the integration’s Alert pipeline tab; see alert pipeline.

Alibaba Cloud Message Center

The “Robot Reception” feature in Alibaba Cloud’s account Message Center can push account, product, and security notices to a custom webhook. Its data format can reuse the Dingtalk robot protocol, so it connects directly to the DingTalk Bot Compatible integration on this page.
  1. Log in to Alibaba Cloud Message Center, go to Robot Reception Management → Robot Management → Add Robot
  2. Select Custom for Robot Platform, enter the DingTalk Bot Compatible Integration URL from above for Webhook Address, and select Format A (typically used by Dingtalk) for Data Format
  3. Complete the CAPTCHA verification and save
Notices from Message Center are one-shot — there is no paired recovery message. Refer to “Push modes and rules” above and configure Trigger or update alert based on message title or Trigger or close alert based on rules so alerts don’t stay open forever.
If you’re integrating Alibaba Cloud Monitor (CloudMonitor) alerts, use the Alibaba Cloud Monitor CM Metrics Integration directly for full dedup and recovery support.