Default service discovery scrapes monitoring metrics from pods in your cluster that match Prometheus scraping rules, helping you with cluster O&M and performance analysis.
Notes
-
Available only for container environments.
-
In a cluster, Managed Service for Prometheus automatically scrapes metrics from pods with annotations in the
arms-promnamespace, regardless of whether default service discovery is enabled.
Billing
-
Default service discovery incurs charges. For more information, see Product Billing.
-
If your cluster already runs an open-source Prometheus service with default service discovery configured, integrating Managed Service for Prometheus inherits that configuration, and Managed Service for Prometheus incurs charges for default service discovery. For more information, see Product billing.
Prerequisites
-
An ACK cluster is created as a container environment. For more information, see Create an ACK cluster.
-
The cluster is connected in the Integration Center. For more information, see Integration overview.
ImportantConnect the cluster to Prometheus through the Integration Center before you enable default service discovery.
Step 1: Add annotations
-
Log on to the ACK console.
On the Clusters page, click the name of your cluster. In the left navigation pane, click .
-
In the Actions column for the target pod, click Edit and add the following annotations.
annotations: prometheus.io/path: /metrics # The HTTP path where metrics are exposed. prometheus.io/port: "xxxx" # The port on which metrics are exposed. prometheus.io/scrape: "true" # Specifies whether to scrape metrics from this pod. -
Click Update.
Step 2: Enable default service discovery
-
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 tab, click Default Service Discovery.
-
On the Default Service Discovery page, click Enable Feature.

After you enable this feature, Managed Service for Prometheus scrapes metrics from all annotated pods in the cluster:
annotations: prometheus.io/path: /metrics # The HTTP path where metrics are exposed. prometheus.io/port: "xxxx" # The port on which metrics are exposed. prometheus.io/scrape: "true" # Specifies whether to scrape metrics from this pod. -
On the Metric Scraping tab, view the list of all pods discovered by default service discovery.
Operations
On the Default Service Discovery page, click Disable Feature. After you disable this feature, Managed Service for Prometheus stops scraping metrics from pods with prometheus.io annotations.