You can configure custom collection to collect metrics from the specified address in a Container Service for Kubernetes (ACK) cluster or an ECS instance. This way, you can use Alibaba Cloud Managed Service for Prometheus in a flexible, automated, and efficient manner. This topic uses an ACK cluster as an example. The custom collection for an Elastic Compute Service (ECS) instance requires similar operations.
Limits
Only ACK clusters and ECS instances support the custom collection feature.
Billing
The custom collection feature incurs fees. For more information, see Billing rules.
Prerequisites
An ACK cluster is created. For more information, see Create an ACK managed cluster.
Metrics are exposed at an address 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 Customize Collection.
View the custom collection configurations
On the Customize Collection tab, you can view all custom collection configurations in the ACK cluster.
Add a custom collection configuration
On the Customize Collection tab, click Create. In the Add Custom Collection Task panel, set the Task name parameter, modify the YAML template in the code editor, and then click Precheck and Create.
Related operations
Modify a custom collection configuration
In the custom collection configuration list, find the configuration and click Edit in the Actions column. In the Edit Custom Collection Task panel, modify the YAML template.
Delete a custom collection configuration
In the custom collection configuration list, find the configuration and click Delete in the Actions column.
Disable a custom collection configuration
In the custom collection configuration list, find the configuration and click Disable in the Actions column. After you disable a custom collection configuration, it loses effectiveness.