The Lindorm time series engine (LindormTSDB) provides APIs for the remote write and remote read features of Prometheus. You can use these APIs to connect LindormTSDB to Prometheus and specify LindormTSDB as the remote storage of Prometheus. You can also use PromQL to call the APIs to efficiently access data in LindormTSDB.
Write data to LindormTSDB
View the database endpoints for remote read and remote write operations
Log on to the Lindorm console.
On the Instances page, click the ID of the Lindorm instance that you want to manage. The Instance Details page appears.
In the left-side navigation pane, click Database Connections.
Click the Time Series Engine tab.
On the Time Series Engine tab, you can view the endpoints that can be used to access LindormTSDB over the VPC and Internet.
Based on the LindormTSDB endpoints obtained in the console, you can create the endpoints that can be used for remote read and remote write operations in the following formats:
http://ld-****-proxy-tsdb-pub.lindorm.rds.aliyuncs.com:8242/api/prom_write
http://ld-****-proxy-tsdb-pub.lindorm.rds.aliyuncs.com:8242/api/prom_read
Configure Prometheus to remotely read and write data in LindormTSDB
Open the Prometheus.yaml configuration file and append the following content to the file. Replace the URLs in the remote_write and remote_read fields with the endpoints that are created in the preceding step.
remote_write:
- url: "http://ld-****-proxy-tsdb-pub.lindorm.rds.aliyuncs.com:8242/api/prom_write"
remote_read:
- url: "http://ld-****-proxy-tsdb-pub.lindorm.rds.aliyuncs.com:8242/api/prom_read"
read_recent: true
Use PromQL to read data in LindormTSDB
LindormTSDB provides native support for PromQL. For example, you can use the PromQL plug-in of Grafana to connect to and use LindormTSDB. You can perform the following steps to obtain the LindormTSDB endpoint for PromQL:
Log on to the Lindorm console.
On the Instances page, click the ID of the Lindorm instance that you want to manage. The Instance Details page appears.
In the left-side navigation pane, click Database Connections. Then, click the Time Series Engine tab.
On the Time Series Engine tab, click PromQL Compatibility Address to view the endpoints that you can use in PromQL to access LindormTSDB over the VPC and Internet.