This topic describes how to monitor OceanBase Cloud using Prometheus.
Background information
OB Cloud Exporter is a monitoring data collection tool provided by OceanBase Cloud. It handles authentication and retrieves monitoring data for use with your self-managed Prometheus deployment.
For the native monitoring metrics provided by Exporter, including common labels, raw units, and value semantics, see Prometheus monitoring metrics.
Prerequisites
To integrate monitoring data, you must have a self-managed Prometheus and satisfy the following requirements:
- Prometheus integration is available only for running clusters.
- The scrape interval must be at least 1 minute. Shorter intervals trigger rate limiting.
Considerations
If you already use CMS to monitor OceanBase Cloud, review the differences in metric definitions and units before adjusting queries, charts, and alerts for OB Cloud monitoring. For more information, see CMS and OB Cloud monitoring metric compatibility.
Procedure
Obtain the Prometheus
scrape_configfile.Note
For security reasons, a newly generated
scrape_configfile is displayed only once. Copy its contents before closing the page.The generated configuration file takes approximately one hour to be ready for use. Wait one hour before proceeding with the remaining integration steps.
Log in to the OceanBase Cloud console.
In the left navigation pane, choose Integrations > Prometheus Integration.
On the Prometheus Integration page, follow the on-screen instructions to click Generate File to generate and copy the
scrape_configfile. Record thecredentialsandtargetslists.
Integrate it into Prometheus.
In the monitoring directory specified for your Prometheus service, locate the Prometheus configuration file, for example:
/etc/prometheus/prometheus.yml.In the Prometheus configuration file, find the
scrape_configskey and add the scrape configuration obtained in step 1 under this key.In Prometheus, check Status > Targets to confirm that the new scrape targets have been loaded. If the changes have not taken effect, you may need to restart the Prometheus service.
Visualize metrics with Grafana.
Download the Grafana dashboard JSON file.
Import this JSON file into Grafana GUI.
(Optional) Customize the dashboard as needed, such as adding or removing panels, modifying data sources, or adjusting display options. For details, see Grafana official documentation.