Custom metric scraping lets you collect monitoring data from specific endpoints on your ECS instances. This improves the flexibility, automation, and manageability of Managed Service for Prometheus.
Limitations
Only containers and ECS instances are supported.
Billing
Custom collection incurs fees. For more information, see Billing for Prometheus instances.
Prerequisites
-
An ECS environment instance is created. For more information, see Create an instance.
-
The ECS instance has a target endpoint that exposes metrics in the standard Prometheus format.
Accessing the feature
-
Log on to the ARMS console.
-
In the navigation pane on the left, click Integration Management.
-
On the Integrated Environments tab, view the ECS Environment list, and click Metric Scraping in the Operation column of the target ECS environment to go to the Metric Scraping page.
-
On the Metric Scraping page, click the Customize Collection tab.
Custom collection list
The Customize Collection page lists all custom monitoring configurations for the current ECS environment.
The list includes fields such as Name, Job name, Component, Service discovery method, metrics_path, and scrape_interval. The Actions column provides options to Disable, Edit configuration, and Delete. Click Create to add a scraping task.
Create a custom collection task
On the Customize Collection page, click Create. In the Add Custom Collection Task panel, specify a Job Name, enter the YAML content for the custom collection in the code editor, and then click Precheck and Create.
The sample YAML configuration defines two scraping jobs, job1 and job2, under scrape_configs. For each job, you can configure parameters such as honor_timestamps, honor_labels, scrape_interval (for example, 30s), scheme (for example, http), and metrics_path (for example, /metric). Use targets within static_configs to specify the scraping endpoints, such as 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.