Updated on 2024-09-06 GMT+08:00

Configuring Metric Management for CCE Clusters

By adding ServiceMonitor or PodMonitor, you can configure Prometheus 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 Prometheus Instance for CCE.

Precautions

Only when kube-prometheus-stack installed on the Add-ons page of CCE or the Integration Center page of AOM is 3.9.0 or later 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 Prometheus instance for CCE.
  4. In the navigation pane on the left, choose Metric Management. On the Settings tab page, click ServiceMonitor.
  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 list.

    Figure 2 Configuring a collection rule

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 Prometheus instance for CCE.
  4. In the navigation pane on the left, choose Metric Management. On the Settings tab page, click PodMonitor.
  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 list.

    Figure 4 Configuring a collection rule

More Operations

Perform the operations listed in Table 1 if needed.

Table 1 Related operations

Operation

Description

Checking metric management configuration

  • In the list, check information such as the name, tag, namespace, and configuration mode. You can filter information by cluster name, namespace, or configuration mode.
  • Click in the Operation column. In the displayed dialog box, view details about the ServiceMonitor or PodMonitor collection rule.

Enabling or disabling collection rules

On the Settings tab page of the Metric Management page, click in the Status column to enable or disable collection rules. indicates that collection rules are disabled. indicates that collection rules are enabled.

Deleting metric management configuration

Click in the Operation column.