This topic describes how to integrate OceanBase business monitoring with Prometheus.
Scenarios
You want to use your own Prometheus system to monitor business operations.
Prerequisites
You have logged in to OCP as a user with the following permissions:
- Permissions on one of the following resources: Cluster Read-Only, Tenant Read-Only, OBProxy Read-Only, Arbitration Service Read-Only, Binlog Service Read-Only, or Host Read-Only.
- The System Parameters menu permission.
You have deployed a Prometheus service of V2.28 or later.
You have deployed OCP V4.2.2 or later.
You have an account with the Host Read-Only permission. We recommend that you create a dedicated user and assign the HOST_VIEWER role (OCP Host Read-Only role) to this user.
Procedure
Log in to the OCP console.
In the left-side navigation pane, choose System Management > System Parameters. Check the values of the following three system parameters.
ParameterDescriptionValueocp.monitor.prometheus.service.discovery.enabled Specifies whether to enable the Prometheus HTTP service discovery service. true ocp.monitor.server.exporter.auth.enabled Specifies whether to enable OCP self-monitoring authentication. false ocp.agent.auth.metric-auth-enabled Specifies whether to enable monitoring API authentication for OCP Agent. false Configure the scraping settings in the Prometheus configuration file. The following example shows the configuration:
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: '******'ParameterDescriptionurl The IP address, port, and API name of the OCP service. username The account name. We recommend that you create a dedicated user and assign the HOST_VIEWER role (OCP Host Read-Only role) to this user. password The account password. After the configuration is complete, Prometheus can obtain the exporter address through an interface to scrape data and monitor the system.
Log in to the Prometheus service address, choose Status > Targets. Check whether the required exporter address is found.
References
OCP V4.3.0 supports connecting to Prometheus data sources on the GUI. For more information, see Monitor and query data from an external time series system.
If you are using the Grafana GUI for data visualization, you can download the OCP Grafana template JSON file from the following documentation: Grafana dashboard.
