Integrate monitoring data to an external time-series system

2024-08-23 10:14:19  Updated

OceanBase Cloud Platform (OCP) V4.3.0 and later allow you to integrate monitoring data to an existing time-series system, such as Prometheus and Simple Log Service (SLS) MetricStore. This reduces the workload of OCP-Server in collecting and calculating monitoring data and improves the throughput of query APIs. To do so, you need to configure the destination address and authentication information.

Prerequisites

  • You have collected time-series monitoring data from OCP-Agent by using Agent Remote Push or Pushgateway.

  • The OCP container is connected to the time-series system.

Integration with Prometheus

You can use the config_properties table in the meta tenant of OCP to specify Prometheus configuration items. The following table describes the configuration items.

key Built-in Required Effective only after restart Description
ocp.monitor.metric.service.type Yes Yes Yes The type of the data source for querying monitoring data. The default value is LOCAL, which indicates the MonitorDB. You need to change the value to PROMETHEUS, which is case-insensitive.
ocp.monitor.query.prometheus.address No Yes Yes The IP address of the server where Prometheus is deployed, such as 127.0.0.1.
ocp.monitor.query.prometheus.port No Yes Yes The service port of Prometheus, such as 9090.
ocp.monitor.query.prometheus.authentication.username No No Yes The username used to authenticate the HTTP request to the query API of Prometheus.
ocp.monitor.query.prometheus.authentication.password No No Yes The password used to authenticate the HTTP request to the query API of Prometheus.
ocp.monitor.query.prometheus.connect.timeout No No Yes The timeout period for the HTTP request to establish a socket connection with the query API of Prometheus, in ms. The default value is 3000 ms.
ocp.monitor.query.prometheus.read.timeout No No Yes The timeout period for the HTTP request to wait for a response from the query API of Prometheus, in ms. The default value is 3000 ms.

Non-built-in configuration items are not contained in the config_properties table by default. Therefore, to view or configure a non-built-in configuration item, you need to execute an SQL statement on the CLI to insert the non-built-in configuration item into the table at initial use.

To insert the configuration item ocp.monitor.query.prometheus.address, execute the following statement:

INSERT INTO `config_properties` (`key`, `value`, `need_restart`, `description`) VALUES ('ocp.monitor.query.prometheus.address1', '127.0.0.1', 1, 'Prometheus service deployment address');

After all configuration items are updated, restart OCP. Then, you can see that the data source for querying monitoring data and alert data has been changed to Prometheus.

Integration with SLS

The SLS configuration items are similar to those of Prometheus and are described in the following table.

key Built-in Required Effective only after restart Description
ocp.monitor.metric.service.type Yes Yes Yes The type of the data source for querying monitoring data. The default value is LOCAL, which indicates the MonitorDB. You need to change the value to SLS, which is case-insensitive.
ocp.monitor.query.sls.end-point No Yes Yes The SLS endpoint.
ocp.monitor.query.sls.sls-project No Yes Yes The SLS project space.
ocp.monitor.query.sls.sls-metricstore No Yes Yes The SLS MetricStore.
ocp.monitor.query.sls.access-key No Yes Yes The AccessKey ID used to access SLS.
ocp.monitor.query.sls.access-secret No Yes Yes The AccessKey Secret used to access SLS.
ocp.monitor.query.sls.connect.timeout No No Yes The timeout period for the HTTP request to establish a socket connection with the query API of SLS, in ms. The default value is 3000 ms.
ocp.monitor.query.sls.read.timeout No No Yes The timeout period for the HTTP request to wait for a response from the query API of SLS, in ms. The default value is 3000 ms.

By default, Non-built-in configuration items are not contained in the config_properties table by default. Therefore, to view or configure a non-built-in configuration item, you need to execute an SQL statement on the CLI to insert the non-built-in configuration item into the table at initial use.

To insert the configuration item ocp.monitor.query.sls.sls-metricstore, execute the following statement:

INSERT INTO `config_properties` (`key`, `value`, `need_restart`, `description`) VALUES ('ocp.monitor.query.sls.sls-metricstore', 'ob_metricstore', 1, 'SLS metricStore');

After all configuration items are updated, restart OCP. Then, you can see that the data source for querying monitoring data and alert data has been changed to SLS.

Contact Us