Applications running on ECS instances often expose Prometheus metrics that need to be collected and monitored centrally. Custom metric scraping in Alibaba Cloud Managed Service for Prometheus collects these metrics by scraping specified endpoints on your ECS instances. You define scrape targets through a YAML configuration in the ARMS console.
Limits
Only ACK clusters and ECS instances support custom metric scraping.
Billing
Custom metric scraping incurs fees. For details, see Billing.
Prerequisites
Before you begin, make sure that you have:
An ECS instance. For more information, see Create an instance
A metrics endpoint exposed within the ECS instance (for example, an application serving Prometheus-format metrics at
http://localhost:<port>/metrics)
Navigate to custom collection
Log on to the ARMS console.
In the left-side navigation pane, click Integration Management.
On the Integrated Environments tab, find the ECS instance and click Metric Scraping in the Actions column. The Metric Collection tab appears.
On the Metric Scraping tab, click Customize Collection.
The Customize Collection tab lists all custom collection configurations for the ECS instance.

Create 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 to define your scrape targets and collection parameters.
Click Precheck and Create. ARMS validates the configuration before creating the task. If validation fails, fix the reported errors and try again.

Edit 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 as needed.
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 configuration, it stops collecting metrics until you re-enable it.
Delete a custom collection configuration
In the custom collection configuration list, find the configuration and click Delete in the Actions column.