Configure event-triggered diagnostic tasks
Event-triggered diagnostic tasks receive alerts from DataWorks, CloudMonitor, and other monitoring systems. AI Assistant calls the enabled query capabilities to verify the situation and generates a diagnosis that covers evidence, impact scope, cause assessment, and handling suggestions. The result is pushed through IM channels, and the account mapping mentions the corresponding owner. This topic describes how to enable event ingestion, create event tasks, connect alert sources, and verify and troubleshoot the configuration.
Overview
Event tasks work with AI Assistant on the principle that the dedicated URL is the task identity: each event task has a unique dedicated ingestion URL, and an alert sent to that URL triggers the corresponding task. You can create multiple event tasks in one instance. Split them by system or handling process, and configure the task content and push targets separately. The full workflow is as follows:
-
When an alert source (a DataWorks custom webhook, a CloudMonitor callback, or similar) meets its trigger condition, it POSTs a JSON alert to the dedicated ingestion URL of the event task. Copy this URL after you create the task in Step 2, and configure it in the alert source in Step 3.
-
Event ingestion validates the request against the IP whitelist and the API key.
-
After the request passes validation, it is routed to the event task that corresponds to the URL.
-
Based on the task content, AI Assistant uses the alert payload as clues to call the enabled skills and expert suites, queries the actual runtime status, and generates a diagnosis. The result is pushed to IM through the account mapping, which mentions the corresponding owner.
Event tasks respond passively after an alert arrives. To proactively find risks that have not triggered alerts, create scheduled inspection tasks separately. The two task types are independent and can be combined.
Prerequisites
-
A DataWorks AI Assistant service instance is activated and deployed, and the instance is in the Running state. For information about how to create and deploy an instance, see Use the AI assistant service.
-
The image version of the AI Assistant instance meets the requirements of the event trigger and account mapping features. If the related entries are not displayed, upgrade the instance first.
-
The execution identity configured for AI Assistant has query permissions on the target projects, jobs, and clusters.
-
The alert system can reach the event ingestion URL of the instance, and the callback egress IP addresses are confirmed.
-
To push diagnosis results to an IM group and mention owners, first connect at least one IM channel through Channel Configuration on the Basic Information tab of the instance (see IM integration), and complete account mapping (see Configure IM account mapping for @-mentions in AI Assistant).
Step 1: Enable event ingestion
In Event Trigger Configuration, enable ingestion, create an API key, and configure the callback IP whitelist. A request must pass both the IP whitelist and API key validation.
-
Log on to the DataWorks console. In the left-side navigation pane, click AI Assistant Service, click the target instance name to open the details page, and click the AI Scheduled Task tab.
-
Click Event Trigger Configuration, and turn on the switch on the Event Ingestion tab.
-
On the API Key tab, create and enable a key. Keep the full event ingestion URL that contains the key secure.
-
In Event Callback IP Whitelist, add the egress addresses of the callback senders. The following table describes how to obtain the addresses for each source:
Alert source
How to obtain the egress address
DataWorks
Select the region that sends the alerts as described in Custom webhook integration
CloudMonitor
See Threshold-triggered alert callbacks and System event alert callbacks, and add the officially published fixed IP ranges to the whitelist
Other systems
Ask your administrator for the actual egress IP addresses or CIDR blocks
-
If the event execution concurrency is configurable, adjust it based on the alert volume. If the instance image version does not meet the feature requirements, upgrade the instance first.
Step 2: Create event-triggered diagnostic tasks
Create a dedicated event task for each alert type, configure its query scope and output requirements, and copy the event ingestion URL of each task from the task list.
-
In AI Scheduled Task > In-instance Tasks of the instance, click Create AI Scheduled Task. For example, create "DataWorks key task anomaly diagnosis" first.
-
Enter the task content. Specify the payload fields to identify, the query capabilities to use, the output structure, and the owner reminder rules. Set Trigger Method to Event Trigger.
-
Turn on Result Push, select the receiving group, and add other targets as needed. The receiving group list comes from the connected IM channels. If the list is empty, complete IM channel connection and account mapping first. After you save the task, click Copy Event Ingestion URL in the actions column of the task.
-
Create tasks for Flink, EMR, and other systems in the same way, and copy their ingestion URLs separately. Record the task, URL, and receiving group for each alert rule to prevent alerts from being routed to the wrong task.
The following table provides a planning reference for three typical event tasks, including the recommended ingestion method, diagnosis focus, and push targets.
|
Task |
Recommended ingestion method |
Diagnosis focus |
Push targets |
|
DataWorks key task diagnosis |
DataWorks Operation Center custom webhook |
Failed or delayed nodes, upstream and downstream dependencies, key outputs, and rerun prerequisites |
Data platform receiving group and task owners |
|
Flink real-time pipeline diagnosis |
CloudMonitor alert callback or Flink platform events |
Job status, restart and failure records, processing latency, and downstream impact |
Real-time computing receiving group and job owners |
|
EMR compute diagnosis |
CloudMonitor alert callback or EMR platform events |
Cluster resources, failed jobs, and related DataWorks tasks |
EMR receiving group and cluster owners |
When you configure multiple event tasks, do not use the instance-level default ingestion URL generated with the API key. That URL always points to the earliest created event task. Use the dedicated ingestion URL copied from each task in the task list instead. In the task content, specify which event types require reminders and who to remind.
When you create an event task, use the following example as a reference for the task content, and add the objects and fields to query for your DataWorks, Flink, or EMR scenario:
After an event arrives, first identify the source, object, occurrence time, alert status, and severity.
Treat the event payload as clues. Use the capabilities authorized for this instance to query the latest status, failure records, logs, metrics, and upstream and downstream impact of the object.
Distinguish confirmed facts, possible causes, and information to be confirmed. State the query basis for important conclusions.
Output the following fields: event summary (source, object, occurrence time, current status, severity); verification evidence (systems queried, key records, metrics and timestamps, with failed queries noted); impact scope (confirmed upstream, downstream, and business outputs, with unknown parts clearly marked); cause assessment (confirmed causes, possible causes, and undetermined cases); handling suggestions (recommended actions, execution prerequisites, risks, and who must confirm); owners (related Alibaba Cloud accounts and people to remind, marked as to be confirmed if not found); verification steps (job status, metrics, and downstream data to recheck after handling).
When the task requires a reminder, mention the corresponding owners in the target IM channel through the account mapping. Do not mention anyone when there is nothing to alert or remind.
Do not automatically restart, rerun, scale out, or modify configurations without human confirmation.
Step 3: Connect alert sources
Select the tab for your monitoring platform to view the integration steps:
DataWorks alerts
DataWorks sends JSON alerts to event tasks through custom webhooks. This method is available in Enterprise Edition and sends alerts over the Internet by default. For more information, see Custom webhook integration. Alert fields vary by rule, so base the task content on the actual payload.
-
In the DataWorks console, switch to the region of the alerts and go to Data Dev & O&M > Operation Center. Select the workspace, and then go to Monitoring and Alerting > Rule Management.
-
Create or edit a custom monitoring rule. Select the task nodes, baselines, or resource groups to monitor, and set trigger conditions such as error, uncompleted, timeout, or resource risk.
-
In the alert action, select Custom Webhook, which is supported by Enterprise Edition. Enter the dedicated URL of the DataWorks event task copied in Step 2, set an appropriate alert count and minimum interval, and then save and enable the rule.
-
If the whitelist is enabled for event ingestion, add the DataWorks public egress IP addresses of the region to the whitelist as described in the custom webhook integration topic. If the tenant alert policy sends alerts through a serverless resource group, verify the actual network egress and connectivity.
For information about how to configure monitored objects, trigger conditions, and alert methods, see Create a custom alert rule. Send a test message first, and then use one controllable real alert to verify that the task identifies the alert fields correctly.
CloudMonitor alerts
For CloudMonitor threshold-triggered alerts, configure an alert callback in the alert rule. For system events, configure a webhook push channel in the event subscription. Threshold callbacks are usually POST forms. For system events, use POST JSON.
-
Threshold-triggered alerts: Go to Alert Service > Alert Rules, modify the target rule, enter the task URL in Alert Callback, verify with the callback test on the page, and then save the rule.
-
System events: Go to Event Center > Event Subscription > Push Channel. Create a channel with the target type Webhook, the method POST, and the data format JSON, and enter the task URL. Then create a subscription policy, select the channel, and verify with the event subscription debugging feature.
For the IP ranges, payload fields, and console steps, see Threshold-triggered alert callbacks and System event alert callbacks.
Other monitoring platforms
Other monitoring systems can also push events to the dedicated task URL. Before configuration, confirm the request method, message format, timeout and retry behavior, and egress IP addresses, and send a test event to verify that AI Assistant identifies the object and status. Use separate tasks for different systems so that you can configure the task content and push targets separately.
Step 4: Verify and troubleshoot
After the configuration is complete, the following shows an example of the diagnosis message that AI Assistant pushes to the IM group. The actual content varies by alert type and the enabled query capabilities:
[DataWorks key task anomaly] Order wide table task failed
· Summary: Task dwd_order_wide failed at 06:12. Status = Failed. Severity = High.
· Evidence: Instance run logs show that upstream ods_order produced no output (queried at 06:15).
· Impact: Three downstream report tasks will be delayed. No baseline breach so far.
· Cause: Missing upstream dependency (confirmed); resource waiting (to be confirmed).
· Suggestion: Rerun dwd_order_wide after ods_order produces output. Confirmation by an authorized person is required.
· Owner: @Zhang San (task owner)
· Verification: After the rerun succeeds, recheck downstream outputs and key metrics.
Verify the full workflow in the following order:
-
Send a controllable alert and check whether the callback arrives in Event Trigger Configuration > Recent Events.
-
In AI Scheduled Task > Execution Records of the instance, check the queuing, running, and final status of the task. Open Execution details to verify the diagnosis log and query evidence. The page reads up to 1 MB of logs at a time.
-
In the target IM group, check the message content, push targets, and actual mention effect. Then send an event that requires no reminder and confirm that no extra mentions occur.
-
If the rule enables recovery notifications, trigger a recovery event and check whether AI Assistant distinguishes alerts from recoveries. Complete a manual recheck of the job status, key metrics, and downstream data.
If verification fails, use the following table to locate possible causes and check the corresponding configurations. Execution errors and delivery errors are available in the execution details:
|
Symptom |
Possible causes |
|
The callback does not appear in Recent Events |
The ingestion switch is off, the ingestion URL is incomplete or the API key is invalid, the callback source IP is not in the whitelist (for DataWorks, use the official egress IP addresses of the region that sends the alerts), or the alert system failed to send the request. |
|
Recent Events shows that no task was triggered |
The instance-level default URL was used (it always points to the earliest created event task), the dedicated ingestion URL was copied incorrectly, or the target task is not enabled. |
|
The event is received but no diagnosis is generated |
The task is queued or failed, the instance is not running, or query permissions are missing. |
|
The diagnosis result does not reach IM |
Result Push is off, the push target (group or individual) is configured incorrectly, or the IM channel is unreachable. |
|
The result reaches the group but the owner is not mentioned |
The diagnosis could not identify the owner, the Alibaba Cloud account does not match an enabled account mapping, or the channel identifier is invalid (verify with Send Test on the account mapping page). |
After all the preceding checks pass, the main event diagnosis workflow is configured.
Usage notes
-
Keep the ingestion URL secure: The event ingestion URL contains the API key. Do not post it to public groups or write it into public documents. After you rotate the key, update the URL in each alert system promptly.
-
Verify source IP addresses: DataWorks, CloudMonitor, and other systems use different callback egress addresses. After you change the region, resource group, or sending system, update the event callback IP whitelist promptly.
-
Watch the task status: An event in Recent Events only means that the request was received. Check Execution Records to confirm whether the diagnosis is complete. When alerts spike, also check whether tasks are queued or rejected.
-
Grant permissions as needed: Grant AI Assistant only the query permissions required for diagnosis. Rerun, restart, or configuration changes must be confirmed and executed by authorized personnel.
References
-
For information about how to configure the IM channel and account mapping, see Configure IM account mapping for @-mentions in AI Assistant.
-
For information about how to create and deploy an instance, see Use the AI assistant service.