Alibaba Cloud Managed Service for Prometheus allows you to install and configure the AHPA component. Managed Service for Prometheus also provides out-of-the-box dashboards that you can use to monitor your applications. This topic describes how to install and configure the AHPA component in Managed Service for Prometheus.
Prerequisites
A Container Service for Kubernetes (ACK) or ACK Serverless cluster is monitored in Managed Service for Prometheus. For more information, see Enable Managed Service for Prometheus.
AHPA is deployed. For more information, see Deploy AHPA.
Background information
Resource demand is difficult to predict in cloud native scenarios. Horizontal Pod Autoscaler (HPA) provided by Kubernetes scales resources with a scaling delay and the configuration is complex. To resolve the preceding issues, ACK released Advanced Horizontal Pod Autoscaler (AHPA), which is powered by time series intelligence from DAMO Academy. AHPA can automatically learn the pattern of workload fluctuations and predict resource demand based on historical metric data to help you implement predictive scaling.
Limits
You can install the component only for Prometheus for Container Service instances.
Procedures
Entry point 1
- Log on to the ARMS console.
- In the left-side navigation pane, choose .
- Click the name of the Prometheus instance instance that you want to manage to go to the Integration Center page.
Procedure 2: Integration Center in the left-side navigation pane of the ARMS console
Log on to the Application Real-time Monitoring Service (ARMS) console.
In the left-side navigation pane, click Integration Center. In the Application Components section, find AHPA and click Add. In the panel that appears, integrate AHPA as prompted.
Integrate the AHPA component
This section describes how to integrate the AHPA component in the integration center of a Prometheus instance.
Install or add the AHPA component.
If this is the first time that you install the AHPA component, perform the following operation.
In the Not Installed section of the Integration Center page, find AHPA and click Install.
NoteYou can click the card to view the common AHPA metrics and dashboard thumbnails in the panel that appears. The metrics listed are for reference only. After you install the AHPA component, you can view the actual metrics. For more information, see AHPA key metrics.
If you have installed the AHPA component, you must add the component again.
In the Installed section of the Integration Center page, find AHPA and click Add.
On the Configuration tab in the STEP2 section, configure the parameters and click OK. The following table describes the parameters.
Parameter
Description
Exporter Name
The name of the AHPA exporter.
The name can contain only lowercase letters, digits, and hyphens (-), and cannot start or end with a hyphen (-).
The name must be unique.
NoteIf you do not specify this parameter, the system uses the default name, which consists of the exporter type and a numeric suffix.
Metrics scrape interval (seconds)
The interval at which Managed Service for Prometheus collects the monitoring data. Default value: 30.
NoteYou can view the monitoring metrics on the Metrics tab in the STEP2 section.
The installed components are displayed in the Installed section of the Integration Center page. Click the component. In the panel that appears, you can view information such as targets, metrics, dashboard, alerts, service discovery configurations, and exporters. For more information, see Integration center.
View AHPA dashboard data
In the Installed section of the Integration Center page, click AHPA to view the AHPA dashboard data.
The AHPA dashboard data provided by Managed Service for Prometheus includes the CPU utilization, number of pods, and predicted number of pods.
CPU Utilization & Actual POD: displays the average CPU utilization and the number of pods in the current deployment.
Actual and Predicted CPU Usage: displays the total CPU utilization and predicted CPU utilization of the pods in the current workload. If the predicted CPU utilization is greater than the actual utilization, the predicted number of CPUs is sufficient.
Pod Trends: displays the actual number of pods, recommended number of pods, and predicted number of pods.
Actual number of pods: the number of pods that are running.
Recommended number of pods: the number of pods recommended by AHPA. The recommended number of pods is calculated based on the combination of active prediction, passive prediction, and bound interval.
Active prediction: the number of pods that the system proactively identifies and predicts based on historical data.
AHPA key metrics
Metric | Description |
ahpa_proactive_pods | The number of pods that are actively predicted. |
ahpa_reactive_pods | The number of pods that are passively predicted. |
ahpa_requested_pods | The number of recommended pods. |
ahpa_max_pods | The maximum number of pods. |
ahpa_min_pods | The minimum number of pods. |
ahpa_target_metric | The threshold value. |