This topic describes how to integrate OceanBase business monitoring with Prometheus.
Scenarios
You need to use your own Prometheus system to integrate business monitoring.
Prerequisites
You have logged in to OCP and have the following permissions:
- The permissions on Cluster Read-Only, Tenant Read-Only, OBProxy Read-Only, Arbitration Service Read-Only, Binlog Service Read-Only, or Host Read-Only.
- The permission on the System Parameters menu.
You have deployed a Prometheus service of V2.28 or later.
You have deployed OCP V4.2.2 or later.
You have a host read-only account. We recommend that you create a separate account and assign the HOST_VIEWER role (OCP Host Read-Only role) to it.
Procedure
Log in to the OCP console.
In the left-side navigation pane, choose System Management > System Parameters. Check the configurations of the following three system parameters.
Parameter Description Value ocp.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 configuration file of Prometheus. 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 name of the OCP service. username The account name. We recommend that you create a separate account and assign the HOST_VIEWER role (OCP Host Read-Only role) to it. password The account password. After the configuration is complete, Prometheus can obtain the exporter address through an interface to scrape data and perform monitoring.
Log in to the Prometheus service address and choose Status > Targets. Check whether the required exporter address is found.
References
OCP V4.3.0 supports visual monitoring integration with Prometheus data sources. For more information, see Monitor and query external time series systems.
If you are using Grafana dashboards for data visualization, you can download the OCP Grafana template JSON file from the following documentation: Grafana dashboard.