Integrate Flink with Managed Service for Prometheus
This topic describes how to integrate a Realtime Compute for Apache Flink workspace with Managed Service for Prometheus. After you configure the integration, Managed Service for Prometheus pulls performance metrics from Flink. This allows for real-time monitoring and data analysis of your Flink deployments.
Prerequisites
-
Managed Service for Prometheus is activated. For more information, see Billing of Prometheus instances.
-
Realtime Compute for Apache Flink is activated. For more information, see Activate Realtime Compute for Apache Flink.
-
Resource Center is activated. For more information, see Activate Resource Center.
Procedure
-
Log on to the Managed Service for Prometheus console. In the left-side navigation pane, click Integration Center.
-
Search for Alibaba Cloud Flink Service Monitor and click the Alibaba Cloud Flink Service Monitor card.
-
In the Alibaba Cloud Flink Service Monitor dialog box, on the Start Integration tab, select the Flink workspace that you want to integrate and click OK.
In the Configuration section, enter an Integration Name. The name must be 5 to 32 characters and can contain only lowercase letters, digits, and hyphens. Set the Metric Scrape Interval and Metric Scrape Timeout. The default value for both parameters is 30 seconds.
Data integration takes 1 to 2 minutes to complete. The dashboard does not display data until the integration is finished.
View dashboards
Managed Service for Prometheus provides three built-in dashboards for Flink: Flink Monitoring, Flink Session Cluster Monitoring, and Flink Change Data Capture Monitoring. To view the dashboards, follow these steps:
-
Log on to the Managed Service for Prometheus console. In the left-side navigation pane, click Integration Management.
-
On the Integration Management page, click the Integrated Environments tab. Select Cloud Service Region and click the name of the target environment to open its details page.
-
On the Component Management tab, click Dashboards to view the built-in dashboards.
The list of dashboards displays the three pre-built Flink dashboards: Flink Change Data Capture Monitoring, Flink Monitoring, and Flink Session Cluster Monitoring.
Create an alert rule
-
Log on to the Managed Service for Prometheus console . In the left-side navigation pane, click Instances .
-
On the Instances page, click the name of the target instance to go to its details page.
-
In the left-side navigation pane, click Alert rules , and then click Create Alert Rule .
In the Evaluation section, set Metric Group to VVP Flink Basic Alerts and Metric to Deployment Restart. Then, in the Conditions section, configure a threshold for the number of deployment restarts.
-
Check Type: You can create metric alerts based on a Static Threshold or by using Custom PromQL for metrics that are not natively supported by Flink.
-
Filter Conditions: For Namespace , enter the name of your workspace. For Deployment Name , enter the Deployment ID of the target deployment. You can find this ID on the Flink job's Configuration tab. To monitor a specific deployment, select the Equal operator.
For more information about the configuration parameters, see Create a Prometheus alert rule .
-