All Products
Search
Document Center

Managed Service for Prometheus:Use PodMonitor to collect metrics

Last Updated:Aug 12, 2024

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

Procedure

  1. Log on to the Managed Service for Prometheus console.

  2. In the left-side navigation pane, click Integration Management.

  3. 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.

  4. 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.

Note

PodMonitor is disabled by default.

image

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.

image

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.