By configuring PodMonitor, you can collect metrics exposed at the specified pod in a Container Service for Kubernetes (ACK) cluster. This way, you can use Alibaba Cloud Managed Service for Prometheus in a flexible, automated, and efficient manner.
Limits
You can configure PodMonitor to collect metrics only of ACK clusters.
Billing
The PodMonitor feature incurs fees. For more information, see Billing.
Prerequisites
An ACK cluster is created. For more information, see Create an ACK managed cluster.
Metrics are exposed at a pod in the ACK cluster.
Procedure
Log on to the Managed Service for Prometheus console.
In the left-side navigation pane, click Integration Management.
On the Integrated Environments tab, view the environment list on the Container Service tab. Find the ACK environment instance and click Metric Scraping in the Actions column. The Metric Scraping tab appears.
On the Metric Scraping tab, click Pod Monitor.
Enable the PodMonitor feature
On the Pod Monitor tab, click Enabled. Then, you can view all PodMonitor configurations and details in the ACK cluster. Managed Service for Prometheus captures metrics based on the path of the pod at the specified time interval.
PodMonitor is disabled by default.
Manage PodMonitor configurations
Add a PodMonitor configuration
On the Pod Monitor page, click Create. In the Add Pod Monitor Configuration panel, modify the YAML template and click Create.
Modify a PodMonitor configuration
In the PodMonitor configuration list, find the PodMonitor configuration and click Edit in the Actions column. In the Edit Pod Monitor Configuration panel, modify the YAML template.
Disable a PodMonitor configuration
In the PodMonitor configuration list, find the PodMonitor configuration and click Delete in the Actions column.
Disable Pod Monitor
In the PodMonitor configuration list, find the PodMonitor configuration and click Disable in the Actions column. After the configuration is disabled, it loses effectiveness.
Disable the PodMonitor feature
On the Pod Monitor tab, click Feature Disabled. After the PodMonitor feature is disabled, Managed Service for Prometheus does not detect or collect metrics exposed at the pod, though targets that are being collected continue to be collected.