Custom scrape configurations collect metrics from specified endpoints in your containers or ECS instances, making Prometheus monitoring more flexible and automated. This topic uses containers as an example.
Limitations
Only container and ECS environments are supported.
Billing
Custom scrape configurations incur fees. For more information, see Prometheus instance billing.
Prerequisites
-
You have created a container or ECS instance. For more information, see Create an ACK managed cluster and Create an instance.
-
The target endpoint on the container cluster or ECS instance exposes metrics as expected.
Procedure
-
Log on to the ARMS console.
-
In the navigation pane on the left, click Integration Management.
-
On the Integrated Environments tab, in the Container Service list, click Metric Scraping in the Actions column of the target container environment to open the Metric Scraping page.
-
On the Metric Scraping page, click the Customize Collection tab.
Scrape configuration list
The Customize Collection page lists all custom scrape configurations in the current container or ECS environment.
The list displays the Name, Job name, Component, Service discovery method, Scrape path, Scrape interval, and Actions columns. In the Actions column, you can Disable, Edit Configuration, or Delete a configuration. Click Create to add a scrape task. You can also search by task name.
Add a custom scrape configuration
On the Customize Collection page, click Create. In the Add Custom Collection Task panel, specify a Job Name, paste the YAML for your custom scrape configuration into the code editor, and then click Precheck and Create.
The YAML configuration follows the Prometheus scrape_configs format. You can define multiple jobs, such as job1 and job2. Each job supports fields such as honor_timestamps, honor_labels, scrape_interval (for example, 30s), scheme (for example, http), metrics_path (for example, /metric), and targets in static_configs (for example, 127.0.0.1:9090).
Related operations
Edit a custom scrape configuration
In the list of custom scrape configurations, find the configuration to edit and click Edit Configuration in the Operation column. In the Edit Custom Collection Task panel, modify the YAML content.
Delete a custom scrape configuration
In the list of custom scrape configurations, find the configuration to delete and click Delete in the Operation column.
Disable a custom scrape configuration
In the list of custom scrape configurations, find the configuration to disable and click Disable in the Operation column. Disabled configurations have no effect on metric collection.