All Products
Search
Document Center

Container Service for Kubernetes:Horizontal pod autoscaling with Alibaba Cloud Prometheus

Last Updated:Jun 21, 2026

Autoscaling based on only CPU and memory can be insufficient for complex scenarios. To use custom metrics and external metrics from Prometheus for HPA, this topic shows you how to retrieve monitoring data and configure autoscaling. This provides a more flexible scaling mechanism for your applications.

Prerequisites

How it works

By default, HPA only supports autoscaling based on CPU and memory, which can be insufficient for many operational needs. Alibaba Cloud Managed Service for Prometheus is fully compatible with the open source Prometheus ecosystem. It supports monitoring for a wide range of components, provides various out-of-the-box dashboards, and offers a fully managed Prometheus service. The process involves three main steps:

  1. Expose monitoring metrics in an ACK cluster by using Alibaba Cloud Managed Service for Prometheus.

  2. The ack-alibaba-cloud-metrics-adapter component is responsible for converting Prometheus monitoring metrics into Kubernetes aggregated metrics that are consumable by HPA. For more information, see Autoscaling on multiple metrics and custom metrics.

  3. Configure and deploy an HPA to scale based on the metrics from the previous step.

    Metrics are categorized into two types:

This topic describes how to configure ack-alibaba-cloud-metrics-adapter to convert metrics from Alibaba Cloud Managed Service for Prometheus into HPA-compatible metrics and implement autoscaling based on these metrics.

Step 1: Get Prometheus monitoring data

Example 1: Use default ACK metrics

You can use the default metrics from Alibaba Cloud Managed Service for Prometheus, which is installed by default in ACK, for horizontal pod autoscaling. Supported metrics include cAdvisor container metrics, Node-Exporter basic node monitoring metrics, GPU-Exporter metrics, and any other metrics you have integrated with Alibaba Cloud Managed Service for Prometheus. To view the integrated metrics:

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Operations > Prometheus Monitoring.

  3. In the upper-right corner, click Go to ARMS Prometheus.

  4. In the left-side navigation pane of the Application Real-Time Monitoring Service (ARMS) console, click Settings to view all metrics integrated with Alibaba Cloud Managed Service for Prometheus.

Example 2: Use pod-reported metrics

This example deploys a sample application that exposes metrics in the standard Prometheus format, such as the http_requests_total metric, which indicates the number of visits. For more information, see metric_type.

  1. Deploy the application workload.

    1. Log on to the ACK console. In the left navigation pane, click Clusters.

    2. On the Clusters page, click the name of the target cluster. In the left-side navigation pane, click Workloads > Deployments.

    3. On the Deployments page, click Create from YAML in the upper-right corner. On the Create page, select Custom from the Sample Template drop-down list, enter the following YAML, and click Create.

      YAML details

      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: sample-app
        labels:
          app: sample-app
      spec:
        replicas: 1
        selector:
          matchLabels:
            app: sample-app
        template:
          metadata:
            labels:
              app: sample-app
          spec:
            containers:
            - image: registry-cn-hangzhou.ack.aliyuncs.com/acs/autoscale-demo:v0.1.2-dfbc5fd-aliyun
              name: metrics-provider
              ports:
              - name: http
                containerPort: 8080
      ---
      apiVersion: v1
      kind: Service
      metadata:
        name: sample-app
        namespace: default
        labels:
          app: sample-app
      spec:
        ports:
          - port: 8080
            name: http
            protocol: TCP
            targetPort: 8080
        selector:
          app: sample-app
        type: ClusterIP
  2. Add a ServiceMonitor.

    1. Log on to the Application Real-Time Monitoring Service (ARMS) console.

    2. In the left-side navigation pane, click Integration Management. On the Integrated Environments page, on the Container Environment tab, select the region where your cluster is located, and then click the environment name that matches your cluster name.

    3. On the container environment page, click the Metric Scraping tab. In the left-side navigation pane, click ServiceMonitor. On the ServiceMonitor page, click Create. In the Add ServiceMonitor Configuration panel, click YAML Edit, add the following ServiceMonitor configuration, and then create the ServiceMonitor.

      apiVersion: monitoring.coreos.com/v1
      kind: ServiceMonitor
      metadata:
        annotations:
          arms.prometheus.io/discovery: 'true'
        name: sample-app
        namespace: default
      spec:
        endpoints:
        - interval: 30s
          port: http
          path: /metrics
        namespaceSelector:
          any: true
        selector:
          matchLabels:
            app: sample-app
  3. Verify the monitoring status.

    Click the Self-Monitoring tab. In the Targets section, if default/sample-app/0(1/1 up) is displayed, the application is successfully monitored by Alibaba Cloud Managed Service for Prometheus.

  4. On the Prometheus dashboard, query the value of http_requests_total for a recent time range to confirm that monitoring data is being collected correctly.

Step 2: Configure the ack-alibaba-cloud-metrics-adapter component

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of the target cluster. In the left-side navigation pane, click Applications > Helm.

  3. On the Helm page, find ack-alibaba-cloud-metrics-adapter and click Update in the Actions column.

  4. In the Update Release panel, configure the following YAML, and then click OK.

    YAML details

      AlibabaCloudMetricsAdapter:
      ......
        prometheus:
          enabled: true    # Set to true to enable the Prometheus adapter feature.
          # The URL of your Alibaba Cloud Managed Service for Prometheus instance.
          url: https://cn-beijing.arms.aliyuncs.com:9443/api/v1/prometheus/xxxx/xxxx/xxxx/cn-beijing
        	# If you use Alibaba Cloud Managed Service for Prometheus V1 with token authentication enabled, configure prometheusHeader Authorization.
          prometheusHeader:
          - Authorization: {Token}
          	# If you use Alibaba Cloud Managed Service for Prometheus V2 without password-free access enabled, configure prometheusHeader Authorization.
          # prometheusHeader:
          # - Authorization: Basic <base64Encode(<accessKey:secretKey>)>
          metricsRelistInterval: 1m # The interval at which the metric list is re-fetched. We recommend that you keep the default value of 1m.
        	logLevel: 5								# The debug log level for the component. We recommend that you keep the default value.
          adapter:
            rules:
              default: false  			# The default metric discovery configuration. We recommend that you set this to false.
              custom:
              # Example 1: This is an example of a custom metric configuration.
              # This config converts the Prometheus metric container_memory_working_set_bytes to a custom metric container_memory_working_set_bytes_per_second
              # and the CPU metric container_cpu_usage_seconds_total to container_cpu_usage_core_per_second.
              # You can run the following command to check the memory/CPU value:
              # kubectl get --raw  "/apis/custom.metrics.k8s.io/v1beta1/namespaces/kube-system/pods/*/container_memory_working_set_bytes_per_second"
              # kubectl get --raw  "/apis/custom.metrics.k8s.io/v1beta1/namespaces/kube-system/pods/*/container_cpu_usage_core_per_second"
              # For more information, see https://www.alibabacloud.com/help/en/container-service-for-kubernetes/latest/horizontal-pod-autoscaling-based-on-alibaba-cloud-managed-service-for-prometheus-metrics
              - seriesQuery: 'container_memory_working_set_bytes{namespace!="",pod!=""}'
                resources:
                  overrides:
                    namespace: { resource: "namespace" }
                    pod: { resource: "pod" }
                name:
                  matches: "^(.*)_bytes"
                  as: "${1}_bytes_per_second"
                metricsQuery: 'sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>)' # The labelSelector in the metricsQuery configuration does not inherit the filter labels from seriesQuery.
              - seriesQuery: 'container_cpu_usage_seconds_total{namespace!="",pod!=""}'
                resources:
                  overrides:
                    namespace: { resource: "namespace" }
                    pod: { resource: "pod" }
                name:
                  matches: "^(.*)_seconds_total"
                  as: "${1}_core_per_second"
                metricsQuery: 'sum(rate(<<.Series>>{<<.LabelMatchers>>}[1m])) by (<<.GroupBy>>)'  # The labelSelector in the metricsQuery configuration does not inherit the filter labels from seriesQuery.
              - seriesQuery: 'http_requests_total{namespace!="",pod!=""}'
                resources:
                  overrides:
                    namespace: {resource: "namespace"}
                    pod: {resource: "pod"}
                name:
                  matches: "^(.*)_total"
                  as: "${1}_per_second"
                metricsQuery: 'sum(rate(<<.Series>>{<<.LabelMatchers>>}[2m])) by (<<.GroupBy>>)'
              # Example 2: This is an example of an external metric configuration.
              # For more information, see https://www.alibabacloud.com/help/en/container-service-for-kubernetes/latest/configure-hpa-based-on-external-metrics
              # When adding a new conversion rule, make sure that the metric labels in Alibaba Cloud Managed Service for Prometheus are consistent with the labels here. If not, modify the metric labels in ARMS Prometheus.
              #- seriesQuery: http_requests_total{namespace!="",pod!=""}
              #  resources:
              #    overrides:
              #      # Here, resource refers to a Kubernetes API resource. You can view them by running kubectl api-resources -o wide.
              #      # Here, the key corresponds to the LabelName in the Prometheus data. Make sure this LabelName exists in your Prometheus metric data.
              #      namespace: {resource: "namespace"}
              #      pod: {resource: "pod"}
              #  name:
              #    matches: ^(.*)_total
              #   as: ${1}_per_second
              #  metricsQuery: sum(rate(<<.Series>>{<<.LabelMatchers>>}[2m])) by (<<.GroupBy>>)
              # This is an example of an external metric configuration.
              # For more information, see https://www.alibabacloud.com/help/en/container-service-for-kubernetes/latest/configure-hpa-based-on-external-metrics
              #- seriesQuery: arms_app_requests_count
              #  metricsQuery: sum by (rpc) (sum_over_time(<<.Series>>{rpc="/demo/queryUser/{id}",service="arms-demo:arms-k8s-demo",prpc="__all__",ppid="__all__",endpoint="__all__",destId="__all__",<<.LabelMatchers>>}[1m]))
              #  name:
              #    as: ${1}_per_second_queryuser
              #    matches: ^(.*)_count
              #  resources:
              #    namespaced: false
              # This is an example of a custom metric from a user-defined Prometheus metric: http_requests_total
              # For more information, see https://www.alibabacloud.com/help/en/container-service-for-kubernetes/latest/horizontal-pod-autoscaling-based-on-alibaba-cloud-managed-service-for-prometheus-metrics
              # - seriesQuery: '{__name__=~"^some_metric_count$"}'
              #   resources:
              #     template: <<.Resource>>
              #   name:
              #     matches: ""
              #     as: "my_custom_metric"
              #   metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>)
        ......

    The following table describes some of the fields. For a detailed description of the ack-alibaba-cloud-adapter configuration file, see ack-alibaba-cloud-metrics-adapter component configuration reference.

    Parameter

    Description

    AlibabaCloudMetricsAdapter. prometheus.adapter.rules.custom

    Modify the value of this field to match the content in the example YAML.

    alibabaCloudMetricsAdapter. prometheus.url

    The URL of your Alibaba Cloud Managed Service for Prometheus instance. For information about how to obtain the Prometheus data request URL, see How to obtain the Prometheus data request URL.

    AlibabaCloudMetricsAdapter. prometheus.prometheusHeader[].Authorization

    The authentication information. For more information, see How to obtain the Prometheus data request URL.

    • Prometheus V1: Authentication is not required by default. If token authentication is enabled, you need to configure this field.
      Prometheus V2: Authentication is enabled by default. If password-free access is not enabled, you need to configure this field.

    AlibabaCloudMetricsAdapter. prometheus.adapter.rules.default

    Specifies whether to create predefined metrics. We recommend that you disable this by setting the value to false.

After configuring and deploying the component, run the following commands to verify that the Kubernetes aggregation API is receiving data.

Custom metrics

  1. Use a custom metrics query to view the details and list of available HPA metrics.

    kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1/" | jq .
  2. Query the current values of the container_memory_working_set_bytes_per_second and container_cpu_usage_core_per_second metrics in the kube-system namespace.

    # Query container_memory_working_set_bytes_per_second to view the current working memory size per second for Pods in the kube-system namespace.
    kubectl get --raw  "/apis/custom.metrics.k8s.io/v1beta1/namespaces/kube-system/pods/*/container_memory_working_set_bytes_per_second" | jq .
    # Query container_cpu_usage_core_per_second to view the CPU core usage per second for Pods in the kube-system namespace.
    kubectl get --raw  "/apis/custom.metrics.k8s.io/v1beta1/namespaces/kube-system/pods/*/container_cpu_usage_core_per_second" | jq .

    Sample output:

    {
      "kind": "MetricValueList",
      "apiVersion": "custom.metrics.k8s.io/v1beta1",
      "metadata": {
        "selfLink": "/apis/custom.metrics.k8s.io/v1beta1/namespaces/kube-system/pods/%2A/container_cpu_usage_core_per_second"
      },
      "items": [
        {
          "describedObject": {
            "kind": "Pod",
            "namespace": "kube-system",
            "name": "ack-cost-exporter-7f44d55c66-cgtz7",
            "apiVersion": "/v1"
          },
          "metricName": "container_cpu_usage_core_per_second",
          "timestamp": "2025-12-30T03:30:21Z",
          "value": "4m",
          "selector": null
        }

External metrics

  1. Use an external metrics query to view the details and list of available external HPA metrics.

    kubectl get --raw "/apis/external.metrics.k8s.io/v1beta1/" | jq .
  2. Query the current value of the http_requests_per_second metric in the default namespace.

    kubectl get --raw "/apis/external.metrics.k8s.io/v1beta1/namespaces/default/http_requests_per_second" | jq .

    Sample output:

    {
      "kind": "ExternalMetricValueList",
      "apiVersion": "external.metrics.k8s.io/v1beta1",
      "metadata": {},
      "items": [
        {
          "metricName": "http_requests_per_second",
          "metricLabels": {},
          "timestamp": "2025-12-30T03:29:40Z",
          "value": "328m"
        }
      ]
    }

Step 3: Configure and deploy the HPA

You can expose Prometheus metrics as either custom metrics or external metrics. The following sections describe how to use both methods for HPA scaling.

Custom metrics

  1. Create an hpa.yaml file.

    kind: HorizontalPodAutoscaler
    apiVersion: autoscaling/v2
    metadata:
      name: sample-app-memory-high
    spec:
    # The scaling target for the HPA. The HPA dynamically modifies the number of Pods for this object.
      scaleTargetRef:
        apiVersion: apps/v1
        kind: Deployment
        name: sample-app
    # The minimum and maximum number of Pods for the HPA.
      minReplicas: 1
      maxReplicas: 10
    # An array of metrics to monitor. Multiple metric types are supported.
      metrics:
      - type: Pods
        pods:
          # Metric to use: pods/container_memory_working_set_bytes_per_second.
          metric: 
            name: container_memory_working_set_bytes_per_second
     # The target value is of the AverageValue type. For the Pods metric type, only AverageValue is supported as the target.
          target:
            type: AverageValue
            averageValue: 1024000m       # Here, 1024000m represents a memory threshold of 1 KB. The unit of the metric is bytes per second. 'm' is a Kubernetes precision unit. When decimal values require high precision, Kubernetes uses units like 'm' or 'k'. For example, 1001m=1.001 and 1k=1000.
  2. Create the HPA application.

    kubectl apply -f hpa.yaml
  3. After enabling load balancing for the Service, run the following command to perform a stress test.

    Replace <EXTERNAL-IP> with the actual LoadBalancer external IP address or domain name of the sample-app Service.

    How to get <EXTERNAL-IP>

    1. On the ACK Clusters page, click the name of your cluster. In the left navigation pane, click Network > Services.

    2. In the default namespace, locate the sample-app Service, click Update in the Actions column, and change the Service Type to LoadBalancer.

      For more information, see LoadBalancer.
    3. After the update is complete, wait for an external IP address to appear in the External IP column of the Service list.

    ab -c 50 -n 2000 http://<EXTERNAL-IP>:8080/
  4. Run the following command to view HPA details:

    kubectl get hpa sample-app-memory-high

    Expected output:

    NAME                     REFERENCE               TARGETS         MINPODS   MAXPODS   REPLICAS   AGE
    sample-app-memory-high   Deployment/sample-app   40886272/1024   1         10        1          22s

External metrics

  1. Create an hpa.yaml file.

    apiVersion: autoscaling/v2
    kind: HorizontalPodAutoscaler
    metadata:
      name: sample-app
    spec:
      scaleTargetRef:
        apiVersion: apps/v1
        kind: Deployment
        name: sample-app
      minReplicas: 1
      maxReplicas: 10
      metrics:
        - type: External
          external:
            metric:
              name: http_requests_per_second
              selector:
                matchLabels:
                  job: "sample-app"
    # For the External metric type, only Value and AverageValue are supported as the target types.
            target:
              type: AverageValue
              averageValue: 500m
  2. Create the HPA application.

    kubectl apply -f hpa.yaml
  3. After enabling load balancing for the Service, run the following command to perform a stress test.

    Replace <EXTERNAL-IP> with the actual LoadBalancer external IP address or domain name of the sample-app Service.

    How to get <EXTERNAL-IP>

    1. On the ACK Clusters page, click the name of your cluster. In the left navigation pane, click Network > Services.

    2. In the default namespace, locate the sample-app Service, click Update in the Actions column, and change the Service Type to LoadBalancer.

      For more information, see LoadBalancer.
    3. After the update is complete, wait for an external IP address to appear in the External IP column of the Service list.

    ab -c 50 -n 2000 http://<EXTERNAL-IP>:8080/
  4. Run the following command to view HPA details:

    kubectl get hpa sample-app

    Expected output:

    NAME         REFERENCE               TARGETS    MINPODS   MAXPODS   REPLICAS   AGE
    sample-app   Deployment/sample-app   33m/500m   1         10        1          7m

ack-alibaba-cloud-metrics-adapter configuration

The ack-alibaba-cloud-metrics-adapter component converts Prometheus metrics into HPA-compatible metrics in four steps:

  1. Discovery: The ack-alibaba-cloud-metric-adapter discovers available metrics from Prometheus.

  2. Association: Associates the metrics with Kubernetes resources such as Pods, Nodes, and namespaces.

  3. Naming: Defines the names of the converted metrics for HPA to reference.

  4. Querying: Defines how to query metric data from Prometheus.

For example, the following configuration converts the http_requests_total metric from the sample-app container into http_requests_per_second for HPA:

- seriesQuery: http_requests_total{namespace!="",pod!=""}
  resources:
    overrides:
      namespace: {resource: "namespace"}
      pod: {resource: "pod"}
  name:
    matches: ^(.*)_total
    as: ${1}_per_second
  metricsQuery: sum(rate(<<.Series>>{<<.LabelMatchers>>}[2m])) by (<<.GroupBy>>)

Parameter

Description

seriesQuery

The PromQL expression to request data.

metricsQuery

Performs an aggregation operation on the data requested by the PromQL expression in seriesQuery.

Note

The labelSelector in the metricsQuery configuration does not inherit the filter labels from seriesQuery.

resources

Matches a PromQL data label with a Kubernetes resource. A resource is a cluster API resource, such as a Pod, namespace, or Node. You can view available resources by running the kubectl api-resources -o wide command. The key corresponds to the label name in the Prometheus data, and this label must exist in the data.

name

Uses a regular expression to convert a Prometheus metric name into a more readable name for HPA. This example converts http_requests_total to http_requests_per_second. When you convert external metrics, if the original metric name contains uppercase letters, the new metric name must be in lowercase.

  1. Discovery

    Specify the Prometheus metric to be converted. You can use seriesFilters to precisely filter metrics. seriesQuery can search by labels. Sample code:

    seriesQuery: http_requests_total{namespace!="",pod!=""}
    seriesFilters:
        - isNot: "^container_.*_seconds_total"

    seriesFilters is optional and is used to filter metrics:

    • is:<regex>: Matches metrics that contain the regular expression.

    • isNot:<regex>: Matches metrics that do not contain the regular expression.

  2. Association

    Set the mapping between Prometheus metric labels and Kubernetes resources. The labels for the http_requests_total metric include namespace!="" and pod!="".

    - seriesQuery: http_requests_total{namespace!="",pod!=""}
      resources:
        overrides:
          namespace: {resource: "namespace"}
          pod: {resource: "pod"}
  3. Naming

    Converts the Prometheus metric name to an HPA metric name, but does not change the Prometheus metric name itself. If you use the original Prometheus metric, you do not need to configure this.

    You can run the command kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1" to view all available HPA metrics.

    - seriesQuery: http_requests_total{namespace!="",pod!=""}
      resources:
        overrides:
          namespace: {resource: "namespace"}
          pod: {resource: "pod"}
      name:
        matches: "^(.*)_total"
        as: "${1}_per_second"
  4. Querying

    A template for querying the Prometheus API. The ack-alibaba-cloud-adapter component populates this template with parameters from the HPA, sends a request to the Prometheus API, and provides the returned value to the HPA for scaling.

    - seriesQuery: http_requests_total{namespace!="",pod!=""}
      resources:
        overrides:
          namespace: {resource: "namespace"}
          pod: {resource: "pod"}
      name:
        matches: ^(.*)_total
        as: "${1}_per_second"
      metricsQuery: sum(rate(<<.Series>>{<<.LabelMatchers>>}[2m])) by (<<.GroupBy>>)

Prometheus data request URL

Scenario 1: Alibaba Cloud Prometheus

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Operations > Prometheus Monitoring.

  3. In the upper-right corner, click Go to ARMS Prometheus. In the left-side navigation pane of the Application Real-Time Monitoring Service (ARMS) console, click Settings, then click the Settings tab to get the HTTP API Address (Grafana Read Address).

    We recommend that you use the internal network URL. If the internal network is not accessible, you can use the public network URL.

    To enhance data read security, click Generate token to create a token. You must then include this token in your HTTP API calls for authentication.

  4. Create Prometheus authentication information.

    • Prometheus V1: If token authentication is enabled, configure the token directly in the component configuration.

      On the HTTP API Address (Grafana Read Address) page, find the Token field and click the copy icon to get the token value.

      ...
          prometheus:
            prometheusHeader:
            - Authorization: {Token}
      ...
    • Prometheus V2: AccessKey-based authentication is enabled by default. If you have not enabled password-free access in the Prometheus console, you must Base64-encode your AccessKey and AccessSecret, then enter the result into the ack-alibaba-cloud-metrics-adapter component configuration.

      1. Generate a Base64-encoded string.

        Concatenate your AccessKey ID and AccessKey secret in the AccessKey:AccessSecret format and perform Base64 encoding.

        echo -n 'accessKey:secretKey' | base64
      2. Configure the component by entering the generated string in the Basic <encoded_string> format into the Authorization field of prometheusHeader.

        ...
            prometheus:
              prometheusHeader:
              - Authorization: Basic YWxxxxeQ==
        ...

Scenario 2: Open source Prometheus

For a self-managed open source Prometheus setup, you must expose the standard Prometheus access API through a Service and configure its URL in the metrics-adapter component. This configures HPA to use your open source Prometheus instance as a data source.

This example uses the ack-prometheus-operator community edition Helm chart from the ACK Marketplace. For more information, see open source Prometheus.

  1. Deploy the Prometheus monitoring solution and expose the standard Prometheus API.

    • Log on to the ACK console. In the left navigation pane, click Marketplace > Marketplace.

    • On the Marketplace page, search for and click ack-prometheus-operator, then click Quick Deployment in the upper-right corner.

    • On the creation page, select the Cluster and Namespace, modify the Release Name as needed, and then click Next. Modify the Parameters as needed, and then click OK.

    • Check the deployment result.

      1. Expose the standard Prometheus API via a Service. This example uses the ack-prometheus-operator Service named ack-prometheus-operator-prometheus.

      2. Access ServiceIP:9090 in a browser. To enable public access, expose the Service through a Server Load Balancer (SLB) instance to view the Prometheus console.

      3. In the top menu bar, click Status > Targets to view all scrape jobs.

        If the status of all jobs is UP, all scrape jobs are running as expected.

        The page displays scrape job groups such as alertmanager-main (3/3 up) and apiserver (3/3 up), with the State of all jobs being UP (green).

    • Check the corresponding service and namespace in the Labels.

      This example uses the ServiceName 'ack-prometheus-operator-prometheus' and the ServiceNamespace 'monitoring' to illustrate the URL for this open source Prometheus data request.

      http://ack-prometheus-operator-prometheus.monitoring.svc.cluster.local:9090
  2. Configure the Prometheus data source URL parameter in the component to ensure the component can communicate with Prometheus.

    If you choose to access the standard Prometheus API over the public network, you can configure it as shown in the following example.

      AlibabaCloudMetricsAdapter:
      ......
        prometheus:
          enabled: true
          url: http://your_domain.com:9090   # Replace your_domain.com with your public IP address.

    For the ack-prometheus-operator solution, the url value would be http://ack-prometheus-operator-prometheus.monitoring.svc.cluster.local:9090.

For more information about how to obtain Prometheus data, see Add Prometheus as a data source in Grafana.

Related topics