This topic describes how to import a monitoring dashboard of OceanBase Cloud Platform (OCP) to Grafana.
Scenarios
You need to use your Prometheus and Grafana systems.
Prerequisites
Make sure that you have the following permissions:
- Resource permissions: Cluster read-only, tenant read-only, OBProxy read-only, arbitration service read-only, binlog service read-only, or host read-only permission.
- Menu permissions: Permission on the System Parameters menu of system management.
You have deployed Prometheus V2.28 or later.
You have deployed OCP V4.3.5 or later.
You have the permission to read data in hosts. We recommend that you create a dedicated user for this operation and grant the HOST_VIEWER role to the user. The HOST_VIEWER role has the read-only permission on the OCP host.
Procedure
Configure the Prometheus data source in Grafana.
Configure
prometheus_sd.Log in to the OCP console. In the left-side navigation pane, choose System Management > System Parameters. Set the
ocp.monitor.server.exporter.auth.enabledandocp.agent.auth.metric-auth-enabledparameters tofalse, and restart OCP.Specify information of
ocp_sdin the Prometheus configuration file. Here is an example:scrape_configs: - job_name: ocp_sd http_sd_configs: - url: 'http://xxx.xxx.xxx.xxx:8080/api/v2/monitor/prometheus_sd' basic_auth: username: admin password: '......'Parameter Description url The IP address, port, and API of the OCP service. username The username of the account. We recommend that you create a dedicated user for this operation and grant the HOST_VIEWER role to the user. The HOST_VIEWER role has the read-only permission on the OCP host. password The password of the account. Log in to the Prometheus console and check whether metrics of
ocp_sdare all in theupstate.
Log in to the OCP console, go to the Monitoring Dashboards page, choose Export > Export Grafana Dashboard.
Import the exported JSON file to Grafana.