All Products
Search
Document Center

E-MapReduce:Subscribe to system event notifications

Last Updated:Aug 20, 2026

E-MapReduce (EMR) Serverless Spark integrates with CloudMonitor, letting you subscribe to important events and configure custom alert notifications. This provides real-time updates on event status and progress to accelerate analysis and issue resolution.

Background information

CloudMonitor is a service that monitors Alibaba Cloud resources and internet applications. It offers a unified portal for managing and monitoring system events from various cloud services, providing status updates and alert notifications. For more information, see What is CloudMonitor?.

You can configure alert rules for all system events in CloudMonitor to receive timely notifications.

  • Send alerts by text message, email, DingTalk chatbot, and more.

  • Distribute events to your Message Queue, Log Service, Function Compute, or a webhook for automated handling.

Event subscription types

The following types of event subscriptions are supported.

Event type

Use cases

Monitoring granularity

EMRSpark:JobRun:FAILED

  • Monitor batch tasks and stream tasks submitted from Data Development. An alert is triggered when a task fails.

    Monitoring batch tasks and stream tasks submitted to a Spark cluster is not supported.

  • Monitor sessions and batches launched through Livy Gateway or Kyuubi Gateway. A launch exception triggers an alert.

  • Monitor SQL, Notebook, and Spark Thrift Server sessions. A session exception triggers an alert.

Task level

EMRSpark:JobRun:TIMEOUT

Monitor tasks that do not complete within a preset time. A task timeout triggers an alert.

Task level

EMRSpark:Workflow:TaskStateChange

Monitor state changes of workflow nodes. An alert is triggered on each state change.

Workflow node level

For more information about system events, go to the CloudMonitor console and search for events whose names contain "EMRSpark".

Create a subscription policy

This topic provides an example of how to create a subscription policy. In this example, you subscribe to the EMRSpark:Workflow:TaskStateChange event and receive a notification when a workflow node fails. This ensures prompt detection and handling of node failures.

Note

Workflow state change events may not appear immediately in the CloudMonitor console. A delay of a few minutes is normal.

  1. Obtain the event resource ID.

    1. Log on to the Cloud Monitor console.

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

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

    4. In the list of filtered events, find the resource ID of your target event.

      The resource ID is in the format: acs:emr:cn-hangzhou:<your Alibaba Cloud account ID>:resourceId/workspaceId/<workspaceId>#workflowDefinitionName/<workflowDefinitionName>#taskDefinitionName/<taskDefinitionName>. You can also construct the resource ID using this format.

  2. Subscribe to event notifications.

    1. In the left-side navigation pane, choose Event Center > Event Subscription.

      Note

      You can also create a subscription policy from the System Event menu as follows:

      1. In the left-side navigation pane, choose Event Center > System Event.

      2. In the Welcome to the New Event Center section, click Create Now.

    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 Event.

      • Subscription Scope:

        • Product: Select E-MapReduce.

        • Event Name: Select EMRSpark:Workflow:TaskStateChange.

        • Event Content: Enter toState: FAILED.

          The subscription policy is triggered only when the task state changes to FAILED. The following table lists the supported states.

          Node states

          Node state

          State code

          Description

          Success

          SUCCESS

          The task completed successfully.

          Running

          RUNNING

          The task is in progress.

          Failed

          FAILED

          The task failed due to an error or exception.

        • Event Resources: Enter the resource ID from the previous step.

        • Event Type, Event Level, and application group: Leave these parameters unconfigured.

      • Deduplication: Use the default settings.

      • Notification: Create a notification configuration and use the default Custom Notification Method.

        To create a notification configuration, enter a name, set Notification Settings to Set notification group directly, select an alert contact group, and then click OK.

        Note

        For more information about how to create a notification configuration, see Create a notification policy.

        CloudMonitor sends notifications using the methods specified for contacts in the alert contact group. For example, if a contact's profile includes a mobile number and email address, and you use the default Custom Notification Method, that contact receives alerts by phone call, text message, and email only.

      • Push and Integration: Leave this section unconfigured.

        Note

        For more information about how to create a push channel, see Create a push channel.

    4. Click Submit.

Debug an event subscription

After you create a subscription policy, you can use the debug feature to verify that it triggers notifications correctly.

  1. On the Subscription Policy tab, click Debug Event Subscription.

  2. In the Create Event Debugging panel, select E-MapReduce for Product and EMRSpark:Workflow:TaskStateChange for Name.

    The system automatically generates the debugging content in JSON format.

  3. Click OK.

    The system displays an Operation successful message, and CloudMonitor automatically sends a test alert to the specified contacts based on the subscription policy.

FAQ

How do I register alerts for multiple tasks in a single subscription?

To receive alerts for multiple tasks, separate their resource IDs with commas (,) in the Event Resources field. 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 register alerts for both task success and failure in a single subscription?

To receive alerts for multiple states, separate the conditions with commas (,) in the Event Content field. For example: toState: FAILED, toState: SUCCESS.

Note

We recommend registering events for the RUNNING state separately from SUCCESS or FAILED states. The RUNNING state can be triggered multiple times, which may create unnecessary notification noise. Separating them helps you manage event notifications more effectively.

How do I configure alerts for task failures from different submission methods in the same workspace?

  1. Obtain the event resource ID. The format is acs:emr:<region-id>:<your Alibaba Cloud account ID>:resourceId/<workspaceId>.

  2. In the subscription policy, select EMRSpark:JobRun:FAILED for Event Name.

  3. For Event Content, enter the corresponding keyword.

    Keyword

    Description

    Batch job run failed

    A batch task submitted through Data Development failed.

    Stream task run failed

    A stream task submitted through Data Development failed.

    Kyuubi submitted job run failed

    A session or batch launched through Kyuubi Gateway failed.

    Livy session run failed

    A session or batch launched through Livy Gateway failed.

    SQL session run failed

    An SQL session failed.

    Notebook session run failed

    A Notebook session failed.

    Thrift Server session run failed

    A Spark Thrift Server session failed.

  4. For the remaining steps, see Create a subscription policy.