Configuring Service Discovery Using ServiceMonitor
AOM allows you to configure service discovery using ServiceMonitor. With ServiceMonitor, you can specify the namespace to be discovered and select the services to be monitored by matching labels.
Scenario
ServiceMonitor can be used to collect and analyze service running data, helping O&M personnel quickly detect and locate faults, optimize service performance, and ensure high availability and stability of services.
Prerequisites
You have a CCE cluster and have created a node. If no CCE cluster is available, buy a standard or Turbo cluster.
Creating a Prometheus Instance
- Log in to the AOM 2.0 console.
- In the navigation pane on the left, choose Prometheus Monitoring > Instances.
- Click Add Prometheus Instance. Table 1 describes the parameters.
Table 1 Parameters for creating a Prometheus instance Parameter
Example Value
Description
Instance Name
aom-hc
Name of a Prometheus instance. Enter up to 100 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. Do not start or end with an underscore or hyphen.
Enterprise Project
default
Enterprise project.
- If Enterprise Project is set to All on the global settings page, select an enterprise project from the drop-down list here.
- If you have already selected an enterprise project on the global settings page, this option will be grayed and cannot be changed.
Instance Type
Prometheus for CCE
Type of the Prometheus instance.
Description
-
Description of the Prometheus instance. Enter up to 1,024 characters. This parameter is optional.
Tag
-
Click Add and enter a tag key and value to add a tag. This parameter is optional.
- Max.: 20 tags.
- A tag key can contain letters, digits, spaces, and special characters (_.:=+-@), but cannot start or end with a space or start with _sys_.
- A tag value can contain letters, digits, spaces, and special characters (_.:/=+-@).
- Click OK. A Prometheus instance for CCE will then be created.
Configuring a CCE Cluster
- Log in to the CCE console. In the navigation pane on the left, choose Clusters.
- On the displayed page, click the name of the cluster purchased in Prerequisites. The cluster details page is displayed.
- In the navigation pane on the left, choose Cluster > Add-ons. On the Add-ons page, set Type to Cloud Native Observability.
- Click Install on the Cloud Native Cluster Monitoring card to install the add-on.
- When installing this add-on, you need to enable Report Monitoring Data to AOM and select the Prometheus instance created in Prerequisites from the Target AOM Instance drop-down list. Set other parameters as required. For details, see Installing the Cloud Native Cluster Monitoring Add-on. Figure 1 Data storage configuration
- If the cloud native cluster monitoring add-on has been installed in the cluster, click Edit on the Cloud Native Cluster Monitoring card, and ensure that Report Monitoring Data to AOM is enabled and metrics have been reported to the AOM instance.
- When installing this add-on, you need to enable Report Monitoring Data to AOM and select the Prometheus instance created in Prerequisites from the Target AOM Instance drop-down list. Set other parameters as required. For details, see Installing the Cloud Native Cluster Monitoring Add-on.
Adding ServiceMonitor
- In the navigation pane on the left, choose Prometheus Monitoring > Instances.
- In the Prometheus instance list, click the name of the Prometheus instance created in Prerequisites. The instance details page is displayed.
- In the navigation pane on the left, choose Metric Management. On the Settings tab page, select the CCE cluster prepared in Prerequisites and click ServiceMonitor.
- Click Add ServiceMonitor. In the displayed dialog box, set related parameters and click OK. Figure 2 Adding ServiceMonitor
- Check the new ServiceMonitor displayed in the list below.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot