All Products
Search
Document Center

Managed Service for Prometheus:Default service discovery

Last Updated:May 27, 2025

Alibaba Cloud Managed Service for Prometheus includes default service discovery to collect metrics from Container Service for Kubernetes (ACK) clusters using standard Prometheus rules, streamlining cluster O&M and performance analysis.

Limitation

This feature applies only to instances deployed in ACK clusters.

Billing

  • Default service discovery provided by Alibaba Cloud Managed Service for Prometheus incurs fees.

  • If your cluster previously used open-source Prometheus with default service discovery configurations, migrating to Managed Service for Prometheus retains these settings, resulting in service discovery costs.

Prerequisites

  • An ACK cluster is created and connected to Managed Service for Prometheus through the Integration Center.

    Important

    If your ACK cluster is not connected through the Integration Center, this feature cannot be enabled.

  • Pods requiring metric exposure are annotated with standard Prometheus rules. To add annotations:

    1. Log on to the ACK console.

    2. On the Clusters page, find the cluster and click its name. In the left-side navigation pane, choose Workloads > Pods.

    3. Find the pod and click Edit in the Actions column to add the following annotations:

      annotations:
        prometheus.io/path: /metrics # The HTTP path where you want to expose the metrics. 
        prometheus.io/port: "xxxx" # The port on which you want to expose the metrics. 
        prometheus.io/scrape: "true" # Specify whether to capture the metrics.
    4. Click Update.

Enable default service discovery

  1. In the left-side navigation pane, click Integration Management.

  2. On the Integrated Environments tab, view the environment list on the Container Service tab. Find the ACK instance and click Metric Scraping in the Actions column.

  3. On the Metric Scraping tab, click Default Service Discovery.

  1. On the Default Service Discovery page, click Enabled to enable this feature.

    image

    After it is enabled, Managed Service for Prometheus collects the metrics exposed by all pods with the following annotations in the cluster:

    annotations:
      prometheus.io/path: /metrics # The HTTP path where you want to expose the metrics. 
      prometheus.io/port: "xxxx" # The port on which you want to expose the metrics. 
      prometheus.io/scrape: "true" # Specify whether to capture the metrics.
  2. On the Metric Scraping tab, view the list of pods found by this feature.

Disable default service discovery

On the Default Service Discovery page, click Feature Disabled to disable this feature. After it is disabled, Managed Service for Prometheus no longer collects metrics exposed by pods with the prometheus.io annotations.