Help Center/ Application Operations Management/ User Guide/ Prometheus Monitoring/ Configuring Metric Collection Rules for CCE Clusters
Updated on 2026-07-29 GMT+08:00

Configuring Metric Collection Rules for CCE Clusters

By adding ServiceMonitor or PodMonitor, you can configure metric collection rules to monitor the applications deployed in CCE clusters.

Prerequisite

Both your service and CCE cluster have been connected to a Prometheus instance for CCE. For details, see Using Prometheus Monitoring to Monitor CCE Cluster Metrics.

Constraints

Only when kube-prometheus-stack installed on the Add-ons page of CCE is later than 3.9.0 and is still running, can you enable or disable collection rules.

To view the kube-prometheus-stack status, log in to the CCE console and access the cluster page, choose Add-ons in the navigation pane, and locate that add-on on the right.

Adding ServiceMonitor

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane on the left, choose Prometheus Monitoring > Instances.
  3. In the instance list, click a desired Prometheus instance for CCE. The Metric Management page is displayed.
  4. On the Settings tab page, select a cluster from the Cluster drop-down list and select ServiceMonitor from the Monitoring drop-down list.
  5. Click Add ServiceMonitor. In the displayed dialog box, set related parameters and click OK.

    Figure 1 Adding ServiceMonitor

    After the configuration is complete, the new collection rule is displayed in the collection rule list.

    Figure 2 Collection rule list

Adding PodMonitor

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane on the left, choose Prometheus Monitoring > Instances.
  3. In the instance list, click a desired Prometheus instance for CCE. The Metric Management page is displayed.
  4. On the Settings tab page, select a cluster from the Cluster drop-down list and select PodMonitor from the Monitoring drop-down list.
  5. Click Add PodMonitor. In the displayed dialog box, set related parameters and click OK.

    Figure 3 Adding PodMonitor

    After the configuration is complete, the new collection rule is displayed in the collection rule list.

    Figure 4 Collection rule list

Other Operations

Perform the operations listed in Table 1 if needed.

Table 1 Related operations

Operation

Description

Viewing a metric

In the list, you can view the name, tag, namespace, and configuration mode.

Click View in the Operation column. In the displayed dialog box, view details about the ServiceMonitor or PodMonitor collection rule.

Enabling or disabling a collection rule

On the Metric Management > Settings page, click in the Status column to enable or disable a collection rule. indicates that the collection rule is disabled. indicates that the collection rule is enabled.

Deleting collection rules

Built-in collection rules cannot be deleted.

Click Delete in the Operation column to delete a custom collection rule.