All Products
Search
Document Center

E-MapReduce:Subscribe to system event notifications

Last Updated:Mar 25, 2026

EMR Serverless Spark integrates with CloudMonitor to send alert notifications when jobs fail, time out, or change state. For example, you can receive an email when a workflow node fails, or route failure events to Function Compute to trigger automated remediation.

Alert delivery methods

CloudMonitor is a monitoring service for Alibaba Cloud resources. It provides a unified entry for querying system events across all Alibaba Cloud services. For more information, see What is CloudMonitor.

CloudMonitor supports two alert delivery methods:

  • Send alerts by text message, email, or DingTalk robot.

  • Route events to Message Queue, Simple Log Service, Function Compute, or Webhook. Use this option to automate handling of anomalous activity.

Prerequisites

Before you begin, ensure that you have:

Supported event types

EMR Serverless Spark emits three types of system events:

Event typeWhen it firesMonitoring granularity
EMRSpark:JobRun:FAILEDOnce, when a job run fails. Covers batch jobs and streaming jobs submitted through Data Studio, sessions and batches launched through Livy Gateway or Kyuubi Gateway, and SQL, Notebook, and Spark Thrift Server sessions.Task level
EMRSpark:JobRun:TIMEOUTOnce, when a task does not complete within the configured time limit.Task level
EMRSpark:Workflow:TaskStateChangeEvery time a workflow node transitions to a new state — including RUNNING, SUCCESS, and FAILED.Workflow node level
For EMRSpark:Workflow:TaskStateChange, subscribe to specific states using the Event Content filter (for example, toState: FAILED) to avoid receiving a notification for every state transition.

To see all available EMRSpark events, open the CloudMonitor console and search for EMRSpark.

Usage notes

Before configuring a subscription, note the following:

  • Workflow state change events may be delayed. After a workflow node changes state, the corresponding event can take several minutes to appear in CloudMonitor.

  • `EMRSpark:Workflow:TaskStateChange` fires on every state transition. Without a state filter, you receive a notification for each transition (RUNNING, SUCCESS, FAILED, and so on). Filter by toState: FAILED to receive only failure alerts.

  • Configure RUNNING notifications separately. Set up a separate subscription for job running events to avoid duplicate notifications alongside your success and failure alerts.

Create a subscription policy

This section walks through creating a subscription policy for EMRSpark:Workflow:TaskStateChange filtered to FAILED states, so you get notified only when a workflow node fails.

Step 1: Get the event resource ID

  1. Log on to the CloudMonitor console.

  2. In the left navigation pane, choose Event Center > System Event.

  3. On the Event Monitoring tab, set Product to E-MapReduce and Event Name to EMRSpark:Workflow:TaskStateChange, then click Search.

  4. Find the resource ID of the target event in the filtered results. The resource ID follows this format:

    acs:emr:cn-hangzhou:<Alibaba Cloud account ID>:resourceId/workspaceId/<workspaceId>#workflowDefinitionName/<workflowDefinitionName>#taskDefinitionName/<taskDefinitionName>

    You can also construct the resource ID manually using this format if you know the workspace ID, workflow name, and task name.

    image

Step 2: Create the subscription policy

  1. In the left navigation pane, choose Event Center > Event Subscription. Alternatively, choose Event Center > System Event, then click Create Now in the Welcome To The New Event Center section.

  2. On the Subscription Policy tab, click Create Subscription Policy.

  3. On the Create Subscription Policy page, configure the following parameters:

    • Name: Enter a name for the subscription policy.

    • Subscription Type: Select System events.

    • Subscription Scope:

      • Product: Select E-MapReduce.

      • Event Name: Select EMRSpark:Workflow:TaskStateChange.

      • Event Content: Enter toState: FAILED. This filters the subscription to fire only when a node transitions to the FAILED state.

        The supported node states are:

        Node state list

        Node state

        State code

        Description

        Success

        SUCCESS

        The task completed successfully.

        Running

        RUNNING

        The task is running.

        Failed

        FAILED

        The task failed due to errors or exceptions.

      • Event Resources: Enter the resource ID from Step 1.

      • Event Type, Event Level, and Application grouping: Leave these fields blank.

    • Combined noise reduction: Use the default settings.

    • Notification: Create or select a notification configuration. To create one, enter a name, set Notification settings to Set the notification group directly, select an Alert contact group, then click OK. CloudMonitor sends alerts through the notification methods configured for each contact in the group (for example, phone call, text message, and email). For more information, see Create a notification configuration policy.

    • Push and Integration: Skip this section. For details on setting up a push channel, see Create a push channel.

  4. Click Submit.

Verify the subscription

After creating the subscription policy, use the debug feature to confirm that alerts fire correctly.

  1. On the Subscription Policy tab, click Debug event subscription.

  2. In the Create event debugging panel, set Product to E-MapReduce and Name to EMRSpark:Workflow:TaskStateChange. The system generates debug content in JSON format automatically.

  3. Click OK. The Operation successful message appears. CloudMonitor sends a test alert to the contacts in the subscription policy using the configured notification methods.

FAQ

How do I set up alert notifications for multiple jobs at once?

Enter multiple resource IDs in the Event Resources field, separated by commas. For example:

acs:emr:cn-hangzhou:113545727984****:resourceId/workspaceId/w-3a81b561ddcb2****#workflowDefinitionName/wf_1#taskDefinitionName/pytest,acs:emr:cn-hangzhou:113545727984****:resourceId/workspaceId/w-3a81b561ddcb****#workflowDefinitionName/wf_2#taskDefinitionName/pi_test

How do I subscribe to both job success and failure in a single policy?

Enter multiple conditions in the Event Content field, separated by commas. For example: toState: FAILED, toState: SUCCESS.

How do I filter failure alerts by submission path within a workspace?

  1. Get the workspace-level resource ID in this format: acs:emr:<cn-hangzhou>:<Alibaba Cloud account ID>:resourceId/<workspaceid>.

  2. Create a subscription policy with Event Name set to EMRSpark:JobRun:FAILED.

  3. Enter the relevant keyword in the Event Content field:

    KeywordMatches
    Batch job failedBatch jobs submitted through Data Studio
    Streaming job failedStreaming jobs submitted through Data Studio
    Kyuubi job failedSessions or batches launched through Kyuubi Gateway
    Livy session failedSessions or batches launched through Livy Gateway
    SQL session failedSQL sessions
    Notebook session failedNotebook sessions
    Thrift Server session failedSpark Thrift Server sessions
  4. Complete the remaining steps as described in Create a subscription policy.