This section describes how to integrate the monitoring feature of OceanBase Database into Prometheus.
Scenarios
You need to use your Prometheus system for integrated business monitoring.
Prerequisites
- You have deployed Prometheus V2.28 or later.
- You have deployed OceanBase Cloud Platform (OCP) V4.2.2 or later.
- You have the read permission on the host. We recommend that you create a dedicated user for Prometheus integration and grant the HOST_VIEWER role to the user. The HOST_VIEWER role has read-only permission on the OCP host .
Procedure
Log on to the OCP console.
In the left-side navigation pane, choose System Management > System Parameters. Check the values of the following system parameters.
Parameter Description Expected value ocp.monitor.prometheus.service.discovery.enabled Specifies whether to enable Prometheus HTTP service discovery. true ocp.monitor.server.exporter.auth.enabled Specifies whether to enable authentication for OCP self-monitoring. false ocp.agent.auth.metric-auth-enabled Specifies whether to enable authentication for the monitoring API of OCP-Agent. false Configure the data collection parameters in the Prometheus configuration file. Here is an example:
scrape_configs: - job_name: ocp_sd http_sd_configs: - url: 'http://xxx.xxx.xxx.xxx:port/api/v2/monitor/prometheus_sd' basic_auth: username: a**** password: '******'Parameter Description url The IP address, port, and API of the OCP service. username The name of the account. We recommend that you create a dedicated user for Prometheus integration and grant the HOST_VIEWER role to the user. The HOST_VIEWER role has read-only permission on the OCP host . password The password for the account. After you specify the parameters, Prometheus can call APIs to obtain the exporter addresses and collect monitoring data.
Log on to the service address of Prometheus and choose Status > Targets. Then, verify that the exporter address is correct.