Realtime Compute for Apache Flink supports monitoring and alerting services from CloudMonitor (a free service) or Application Real-Time Monitoring Service (ARMS). Configure metric alerts for jobs, event alerts for jobs, and alerts for workflows to promptly identify and handle exceptions. This topic describes how to configure monitoring and alerting using different monitoring services.
Limitations
-
Monitoring and alerting cannot be configured for Flink jobs submitted to a Session cluster at deployment.
-
Monitoring and alerting are not currently supported for batch jobs.
-
ARMS does not support workflow alerts. However, you can still configure them using CloudMonitor (a free service).
Configuration guide
Based on the monitoring service type used by your workspace (Check monitoring service type), choose the appropriate configuration method:
-
Free monitoring service (CloudMonitor)
-
Metric alert configuration: Configure alerts based on changes in metric values, such as CPU, latency, and data volume. Supports configuration for single or multiple jobs.
-
Event alert configuration (including workflows): Configure alerts based on the occurrence of events, such as job failures. Supports configuration for job and workflow events.
-
-
ARMS monitoring service
-
Metric alert configuration: Configure alerts based on changes in metric values (supports six core metrics). Supports configuration for single or multiple jobs.
-
Event alert configuration: Only job failure events are supported. Other event alerts are not currently supported. You can configure them through CloudMonitor event alert configuration.
-
Switch monitoring service types
You can switch between monitoring service types to meet different business needs.
In the Management Console, in the Actions column for the target workspace, click More to switch to the other monitoring service type.
Read the notes about switching service types carefully. You can proceed with the configuration only after you select the confirmation checkbox.
Configure monitoring and alerting using CloudMonitor
Metric alert configuration
Only the Alibaba Cloud account that purchased the workspace, and the RAM users and RAM roles under that account with namespace permissions, can configure alerts in CloudMonitor.
-
Log on to the Cloud Monitor console.
-
In the navigation pane on the left, choose .
-
Click Create Alert Rule and configure the parameters.
-
Parameter
Description
Product
Realtime Compute for Apache Flink
Resource Scope
Select Instance. The alert rule applies to the specified workspace of Realtime Compute for Apache Flink.
Associated Resources
Click Add Instance, select the workspace in the target region (How do I view information such as the workspace ID?), and then click OK.
Rule Description
Click Add Rule > Simple Metric or Composite Metric to open the Set Rule Description panel.
The panel includes multiple alert levels: Critical, Warn (notifies via SMS, email, and webhook), and Info (notifies via email and webhook). For each level, you can set a threshold condition. For example, the average value is >= a specified threshold for 3 consecutive periods, where 1 period = 1 minute.
In the Dimension section, you can configure the namespace (Flink namespace name) and deploymentID (the deployment ID on the Deployment Details tab of the Flink job) to specify the jobs to monitor.
Note-
If the namespace and deploymentID drop-down lists are empty, you can enter the values manually.
-
If you leave these fields empty, all jobs in all namespaces are monitored.
Note-
In a production environment, single-metric alerts can easily lead to false positives or negatives. Composite metric alerts can more accurately reflect business exceptions. For more information, see Recommended configuration examples and templates for monitoring and alerting.
-
For more information about other parameters, see Create an alert rule.
-
Event alert configuration (including workflows)
Only the Alibaba Cloud account that purchased the workspace, and the RAM users and RAM roles under that account with namespace permissions, can configure alerts or subscribe to events in CloudMonitor.
Job event alerts
Subscribe to system event alerts for jobs by configuring conditions. Batch configuration of event alerts is supported.
-
Log on to the Cloud Monitor console.
-
In the navigation pane on the left, choose .
-
On the Subscription Policy tab, click Create Subscription Policy.
-
On the Create Subscription Policy page, configure the parameters. For more information about the parameters, see Manage event subscriptions (recommended).
-
Subscription Type: System Event.
-
Product: Select Realtime Compute for Apache Flink.
-
Event Name: Supports Job Run Failed (not supported when using the ARMS monitoring service), Post-mortem Processing for ECS Downtime, and Impact of Proactive O&M on ECS events.
-
Event Content: You can specify jobs or configure batch alerts by entering the following Flink information in the event content.
-
Workspace ID: Configure event alerts for all jobs in all namespaces under the target workspace. To view the workspace ID, see How do I view information such as the workspace ID?.
-
Namespace Name: Configure event alerts for all jobs in the target namespace.
-
Deployment Job Name: Configure event alerts for specific jobs. Separate multiple job names with a comma (
,). If there are jobs with the same name under your account, use the DeploymentID instead. -
DeploymentID: Configure event alerts for specific jobs. Separate multiple IDs with a comma (
,). You can find the ID on the Deployment Details tab of the Flink job page as the deployment ID.
-
NoteIf you do not set Application Group, Event Content, or Event Resource, the subscription applies to all workspaces within your account.
-
Workflow event alerts
Subscribe to system event alerts for Flink workflows by configuring conditions. Batch configuration of event alerts is supported. For more information about workflows, see Manage workflows.
-
Get the resource ID of the workflow node.
-
Log on to the Cloud Monitor console.
-
In the navigation pane on the left, choose .
-
On the Event Monitoring tab, set Product to Realtime Compute for Apache Flink and Event Name to Workflow Task Status Change, and then click Search.
-
Find the resource ID of the workflow node below.
On the Event Monitoring page, select Realtime Compute for Apache Flink from the Product drop-down list. In the event list, find the record with the event name flink:Workflow:TaskStateChange Workflow Task Status Change. You can view the resource ID of the workflow node in the Resource column.
The resource format is
acs:flink:cn-hangzhou:<AlibabaCloudAccountId>:resourceId/workspaceId/<workspaceId-namespaceId>#workflowDefinitionName/<workflowDefinitionName>#taskDefinitionName/<taskDefinitionName>. You can also use this format to directly construct the resource ID for your workflow node.Parameter
Description
<AlibabaCloudAccountIdOfWorkspace>The Alibaba Cloud account ID that owns the Flink workspace.
<workspaceId-namespaceId>A combination of the
workspaceIdandnamespaceId, joined by a hyphen (-).workspaceId: The workspace ID. For more information, see Workspace management and operations.namespaceId: The namespace name.<workflowDefinitionName>The workflow name.
<taskDefinitionName>The workflow node name.
NoteThere is usually a delay of several minutes before workflow status change events appear in CloudMonitor.
-
-
Subscribe to event notifications.
-
In the navigation pane on the left, choose .
-
On the Subscription Policy tab, click Create Subscription Policy.
-
On the Create Subscription Policy page, set the parameters for the subscription policy. For more information about the parameters, see Manage event subscriptions (recommended).
-
Subscription Type: System Event.
-
Product: Select Realtime Compute for Apache Flink.
-
Event Name: Select Workflow Task Status Change.
-
Event Content: Supports entering parameters such as
toState: FAILED(workflow failed),toState: SUCCESS(workflow succeeded), andfromState: SCHEDULED, toState: RUNNING(workflow state changed from scheduled to running). -
Event Resource: Enter the workflow resource ID obtained in Step 1. Separate multiple IDs with a comma (
,). -
Event Type, Event Level, Application Group: Do not set any of these.
-
-
Configure monitoring and alerting using ARMS
Metric alert configuration
Multi-metric monitoring in ARMS is only supported through custom PromQL. For a simpler configuration method, use CloudMonitor metric alert configuration.
Configure a single job (Management Console)
You can create a new alert rule for a target job, or you can create an alert rule template and then use it to create alerts for target jobs. This can speed up the configuration of monitoring and alerting.
The Development Console only displays alert events from the last 48 hours. To view older alert events, go to Alert Management in the ARMS console.
-
Go to the alert configuration page.
-
Log on to the Management Console and click Console in the Actions column for the target workspace.
-
On the page, click the name of the target job.
-
Click the Alert Configuration tab.
-
-
On the Alert Rules tab, choose .
You can also choose . By adding and using an alert template, you can create alert rules directly or with minor modifications, which speeds up the configuration process.
-
Enter the alert rule information.
Category
Parameter
Description
Rule Details
Rule Name
Must start with a letter and can only contain lowercase letters, numbers, and underscores (_). The length is limited to 3 to 64 characters.
Description
A note about the rule.
Content
Configure the conditions that trigger an alert. The system compares the specified metric value with the threshold at a specified interval. If the result meets the condition, an alert is automatically triggered.
-
Metric:
-
Restart Count in 1 Minute: The number of times the Job Manager has restarted in 1 minute.
-
Checkpoint Count in 5 Minutes: The number of successful checkpoints in 5 minutes.
-
Emit Delay: The business latency, which is the time difference between when data is generated and when it leaves the Source operator. The unit is seconds.
ImportantThe data generation time depends on the timestamp recorded in the external system. If the external system does not have a timestamp, or if the timestamp is written incorrectly, the Emit Delay value will be inaccurate and will not reflect the true latency. Configure alerts with multiple metrics to determine the real event. For more information, see Recommended configuration examples and templates for monitoring and alerting.
-
IN RPS: The number of input records per second. The unit is records/second.
-
OUT RPS: The number of output records per second. The unit is records/second.
-
Source Idle Time: The time that the source has not processed data. The unit is milliseconds.
-
Job Failed: The job has failed.
-
-
Time Difference: The length of the historical data time window that the system queries backward for each check. The unit is minutes.
-
Operator: Supports >= and <=.
-
Threshold: The value to compare with the metric.
-
If you select the >= operator, the system uses the MAX value from the vertical axis. If the maximum value within the time difference is >= the threshold, the alert rule is triggered.
-
If you select the <= operator, the system uses the MIN value from the vertical axis. If the minimum value within the time difference is <= the threshold, the alert rule is triggered.
-
For example, assume you are monitoring the "Checkpoint Count in 5 Minutes" metric. The time difference is set to 10 minutes, the threshold is 2, and the operator is "<=".
Every minute, the system checks the historical data from the last 10 minutes. If it finds any 5-minute interval where the number of successful checkpoints was less than or equal to 2, it triggers an alert.
Effective Period
The time when the alert monitoring is active. You can specify it to be active only during the day (9:00 to 18:00). By default, it is active all day.
Alert Frequency
Send an alert only once within a continuous number of minutes. Supports 1 minute to 1440 minutes (24 hours).
Notification Method
Notification Method
You can select multiple notification methods. The supported methods are:
-
DingTalk
-
Email
-
SMS
-
Webhook
-
Phone
Ensure that the recipient's phone number has been verified. Otherwise, this method will not work. You can click Notification Contact Management below. If the Phone column for the target contact on the contact tab shows Not verified, click to complete the verification.
Important-
Ensure that you have created and added available notification contacts. Otherwise, the alert notification will fail. For example, if you select DingTalk as the notification method, select DingTalk and add a DingTalk notification contact of the DingTalk chatbot type.
-
For more information about the billing of alert management, see Billing of alerts.
Notification Contact
You can notify multiple contacts at the same time. You can select or search for contacts. Before selecting a contact, you must click Notification Contact Management on the right to create one. For more information, see Workspace management and operations.
Alarm Noise Reduction
Click Advanced Settings, then you can turn on the Alarm Noise Reduction switch.
After you turn on alarm noise reduction, alerts will not be sent for scenarios where the job can recover quickly, such as short-term failovers triggered by cluster scheduling or automatic tuning. Alerts are sent only when the threshold conditions you set are met continuously.
No Data Alarms
Click Advanced Settings, then you can turn on the No Data Alarms switch and enter the continuous no-data time information.
After you turn on this feature, the system monitors for scenarios where no monitoring data is reported. If no data is reported within the selected time period, an alert is triggered. No monitoring data is usually reported when the JobManager is abnormal, the job stops unexpectedly, or the reporting link is abnormal.
-
-
Click OK.
The saved alert rule is enabled by default and appears in the alert rule list. You can choose to stop, edit, or delete it.
Configure single or multiple jobs (ARMS console)
If you change a job name in the Flink console, any alert rule configured in the ARMS console based on the original job name becomes invalid. You must reselect the renamed job and configure the alert for it to take effect.
-
Log on to the Management Console.
-
In the Actions column for the target workspace, choose to go to the ARMS console.
The workspace name, workspace ID, and corresponding Prometheus instance name are displayed at the top.
The navigation pane on the left includes Dashboard List, Service Discovery, Metric Management, Alert Rules, and Settings. The agent status is displayed in the upper right. On the Metrics tab of the Service Discovery page, you can filter metrics by job name, metric type, and other conditions. The metric list displays the metric name, job name, metric type, and other information.
-
Click Alert Rules on the left to create an alert rule.
-
Check Type: Supports metric alerts through static thresholds and custom PromQL (excluding alert metrics already supported by Flink).
-
Filter Conditions: Batch alert configuration is supported. For Namespace, enter the namespace name. Selecting all indicates all namespaces in the workspace. For Deployment Job, enter the deployment ID of the target job in the namespace (found on the Deployment Details tab of the Flink job). Selecting all indicates all jobs in the namespace.
For more information about configuration parameters, see Create a Prometheus alert rule. You can also create a Prometheus alert rule template. For more information, see Create a Prometheus alert rule template.
-
Event alert configuration
Only job failure events are supported. Configure this by selecting the Job Failed rule in the metric alert configuration. Other event alerts are not currently supported. You can configure them through the CloudMonitor event alert configuration.
FAQ
How to add a DingTalk chatbot for alerts in the Development Console
How to create a webhook in the Development Console
How to add a Lark chatbot for alerts in the Development Console
Related documents
-
Realtime Compute for Apache Flink lets you choose either CloudMonitor (a free service) or ARMS Prometheus Monitoring to provide job monitoring and alerting functions. For a detailed comparison of features, costs, and more, see Feature comparison between CloudMonitor and ARMS alert services.
-
ARMS supports the configuration of features such as silence policies, escalation policies, and scheduling. For more information, see Silence policy, Escalation policy, and related practice tutorials.
-
CloudMonitor supports receiving alert notifications through DingTalk groups, Lark groups, and more. For configuration details, see Alert notification methods.
-
For more information about supported monitoring metrics, see Monitoring metrics.
-
You can disable monitoring and alerting or discard specific metrics (when using ARMS) to save costs. You can resume metric collection later if needed. For specific operations, see Discard or restore monitoring metrics.