Managed Service for Prometheus provides one-click installation for the AHPA component and offers out-of-the-box dedicated dashboards. This topic describes how to integrate AHPA with Managed Service for Prometheus.
Prerequisites
-
Managed Service for Prometheus has been activated. For more information, see Billing of Prometheus instances.
-
A Kubernetes cluster has been created. For more information, see Create an ACK managed cluster and Create an ACK Serverless cluster.
-
Alibaba Cloud Resource Center has been activated. For more information, see Activate Resource Center.
-
AHPA has been deployed. For more information, see Deploy AHPA.
Background information
In cloud-native environments, estimating resource capacity is often challenging. When you use the native Kubernetes HPA (Horizontal Pod Autoscaler), you may encounter issues such as elasticity lag and complex configuration. To address these challenges, Container Service for Kubernetes (ACK) and the AI for Time Series team of Alibaba DAMO Academy have jointly introduced AHPA (Advanced Horizontal Pod Autoscaler), which provides elastic forecasting. AHPA automatically identifies elasticity patterns and forecasts capacity requirements based on historical business metrics. This helps you plan elasticity in advance and reduces elasticity lag.
Integrate AHPA
Log on to the Managed Service for Prometheus console. In the left-side navigation pane, click Integration Center.
-
Click the ACK AHPA card and follow the on-screen instructions to integrate the component. The following table describes the key parameters.
Parameter
Description
Automatically Install AHPA Controller
Select this option to automatically install the AHPA Controller in your cluster.
Metrics Collection Interval (s)
The interval for collecting monitoring data. The default value is 15.
The installed component is displayed on the Integration Management page in the Managed Service for Prometheus console. The Integration Management page consists of the Integrated Environments, Integrated Addons, and Query Dashboards tabs, where you can view information such as targets, metrics, dashboards, and alerts.
View AHPA dashboard data
On the Integration Management page, select the Integrated Addons tab and click the AHPA card. Then, select the Dashboards tab and click a dashboard name to view its details.
The AHPA dashboards provided by Managed Service for Prometheus display metrics such as CPU utilization rate, actual pod count, actual and predicted CPU usage, and pod trends.
-
CPU Utilization & Pod Count section: Displays the average CPU utilization rate and the number of pods for the current Deployment.

-
Actual & Predicted CPU Usage section: Shows the total CPU usage of pods in the current workload compared to the predicted usage. If the predicted usage is higher than the actual usage, it indicates that the forecasted CPU capacity is sufficient.

-
Pod Trends section: Displays the actual number of pods, the recommended number of pods, and the number of pods from proactive forecasting.
-
Actual number of pods: The number of currently running pods.
-
Recommended number of pods: The number of pods that AHPA recommends for scaling. This value is based on proactive forecasting, the reactive forecast, and defined limits.
-
Proactive forecasting: The number of pods predicted by the system based on cyclical patterns identified from historical data.

-
Key AHPA metrics
|
Metric |
Description |
|
ahpa_proactive_pods |
The number of pods from proactive forecasting. |
|
ahpa_reactive_pods |
The number of pods from the reactive forecast. |
|
ahpa_requested_pods |
The final number of pods that AHPA recommends for scaling. |
|
ahpa_max_pods |
The maximum number of pods. |
|
ahpa_min_pods |
The minimum number of pods. |
|
ahpa_target_metric |
The scaling threshold. |