Overview
DTS can use EventBridge to configure alarms for abnormal task interruption events. EventBridge will send notifications to recipients as soon as an event is triggered so that they can take timely measures.
After EventBridge is activated, it will automatically create a default Tencent Cloud service event bus in Guangzhou region, to which alarm events generated by DTS will be automatically published.
This document describes how to set notification rules for event alarms, that is, filter alarmed tasks and set the alarm publishing method, alarm notification method, and recipient group.
Prerequisite
Directions
Viewing the event list
2. Click Event Bus on the left sidebar. The default event bus is stored in the Guangzhou region. You don't need to switch the region.
Note
You will be asked to authorize EventBridge when you log in to the EventBridge console for the first time. For directions, see Activating EventBridge. If you have already authorized it, skip this step. 3. Click the Event bus ID and go to Basic information > Event Source > Cloud Monitor to view the DTS monitoring event.
Configuring event alarm rules
2. On the Event Rule page, select a region and event bus and click Create. The default event bus is stored in the Guangzhou region. You don't need to switch the region.
3. On the Basic information page, enter the rule name and description. In the Event matching module below, you can select Template or Custom Event for the Mode field as needed.
If you select Template, you need to configure the Tencent Cloud service and Event Type fields. You can select all events or specific event types for Event Type.
4. After configuring the Rule pattern page, click Next.
5. On the Create event rule > Delivery Target page, set the following parameters and click Complete.
|
Trigger method | Here, select Notification message. |
Message template | |
Alarm content | Chinese is selected by default. You can select other options based on your needs. |
Notification method | You can select either or both of the following two notification methods: API callback and publishing channel. publishing channel: If you select this option, you need to further select the recipients, notification period, and receiving channel. You can configure the sub-accounts under your Tencent Cloud account as the recipients. To add more recipients or recipient groups, go to the CAM console to add them first, then you can select them here. |
Add | To configure different trigger methods, click Add at the bottom to add more delivery targets. |
Enable event rules now | If you select this option, the event rule will immediately take effect after you click Complete. |
6. Return to the event rule list to confirm that the created event rule has been enabled. If any task exception triggers an alarm subsequently, the recipients can receive the notifications.
Sample Syntax for Custom Event Alarms
Below are the sample syntaxes in different scenarios:
Receive alarms of all DTS events. The following syntax represents that alarms can be pushed for all DTS alarm events according to the event rule.
{
"source":"dts.cloud.tencent"
}
Receive event alarms of DTS migration, sync, and subscription tasks. The three fields under the type
of the following syntax represent the migration, sync, and subscription task interruption events respectively. If you don't need to receive alarms of any of these events, delete the corresponding syntax content.
{
"source":"dts.cloud.tencent",
"type":[
"dts:ErrorEvent:MigratejobInterruption",
"dts:ErrorEvent:ReplicationInterruption",
"dts:ErrorEvent:SubscriptionInterruption"
]
}
Receive event alarms of a single DTS task. The following syntax represents that alarms can only be pushed for the alarm event generated by the specified task (ID: sync-jt12XXgt). Those triggered by other events will be discarded and cannot be pushed to recipients.
{
"source":"dts.cloud.tencent",
"subject":"sync-jt12XXgt"
}
Receive event alarms of multiple DTS tasks.
{
"source":"dts.cloud.tencent",
"subject":["sync-jt12XXgt","dts-a5uqXXhs"]
}
Receive event alarms of DTS migration tasks in the specified region. Here, region refers to the target instance region.
{
"source":"dts.cloud.tencent",
"type":"dts:ErrorEvent:MigratejobInterruption",
"region":"ap-guangzhou"
}
For more information about the matching rules, see Event Pattern.
Was this page helpful?