Alibaba Cloud has started the public preview of Time Series Database (TSDB) for InfluxDB®. This makes Alibaba Cloud the first cloud service provider that provides InfluxDB services in China. InfluxDB is a popular time series database that supports high-performance read and write operations. It is widely used in scenarios such as monitoring, Internet of things (IoT), and real-time data analysis. Prometheus is a leading application for metric monitoring. It provides APIs that integrate InfluxDB to remotely store time series data. This provides more stable and reliable storage performance. This topic describes how to connect Alibaba Cloud TSDB for InfluxDB® to Prometheus to build a high-performance storage solution for monitoring data.
Prometheus is a monitoring and alerting system. It was originally developed by SoundCloud and became a popular open source project after it joined Cloud Native Computing Foundation (CNCF) in 2016.
Prometheus supports a multi-dimensional data model, which uses metrics and labels to specify time series data. Prometheus also provides the PromQL query language to support multi-dimensional queries.
Prometheus has a built-in time series database based on local storage. This single-node database has limited scalability, reliability, and functions. To improve the storage performance, Prometheus provides APIs to integrate other storage systems.
The following figure shows the remote storage process of Prometheus.
Prometheus defines the read and write APIs for remote storage. HTTP is defined as the interaction protocol by using Protocol Buffers. To enable a storage system to support Prometheus, an adapter pattern is required to convert the read and write requests of Prometheus to a format supported by the storage system.
TSDB for InfluxDB® (Documentation) provides high-performance data storage and supports retention policies (RPs). This service is a good choice for Prometheus remote storage. TSDB for InfluxDB® supports the Prometheus read and write protocols, integrates the adapter function, and provides two HTTP APIs to process read and write requests from Prometheus:
Prometheus supports multiple operation systems. This topic uses Linux as an example. The operations on macOS and Windows are slightly different.
Before you use the service, you must purchase a TSDB for InfluxDB® instance. This service is in the public preview phase and allows free trial. Click here to go to the buy page.
After you create the instance, you can obtain the endpoint of the instance on the Instance Details page. You can apply for a public endpoint or a VPC endpoint.
This topic assumes that the instance uses the following public endpoint and port:
To use the instance to store Prometheus data, you must create a database.
In the left-side navigation pane, choose Time Series Data Management > Databases. On the Databases page, click Create to create a database.
Set the database name to prometheus. Click OK to create the database.
In the left-side navigation pane, choose Time Series Data Management > Accounts. On the Accounts page, click Create to create a user account.
Set the username to prom. Grant the read and write permissions of the prometheus database to this user. Set and confirm the password, and click OK to create the user.
Download and deploy Prometheus. For more information, see Prometheus documentation.
The Prometheus package for Linux contains a configuration file. To connect TSDB for InfluxDB® to Prometheus, you only need to configure TSDB for InfluxDB® for remote storage in the configuration file.
console_libraries consoles data LICENSE NOTICE prometheus prometheus.yml promtool
Use a text editor (such as Vim) to add the following content to the end of the prometheus.yml file:
- url: "https://ts-1234abcd.influxdata.rds.aliyuncs.com:3242/api/v1/prom/write?db=prometheus&u=prom&p=mypassword"
- url: "https://ts-1234abcd.influxdata.rds.aliyuncs.com:3242/api/v1/prom/read?db=prometheus&u=prom&p=mypassword"
In the preceding content, replace the URL with the public endpoint mentioned above, prom with the user that you have created, and mypassword with your password.
Save the configuration file and start Prometheus.
After you start Prometheus, you can use a browser to access the Prometheus service. The default port of the service is 9090.
- Alibaba Cloud TSDB for InfluxDB® buy page
- Alibaba Cloud TSDB for InfluxDB® documentation
- Prometheus endpoints support in InfluxDB
- Prometheus remote storage
InfluxDB® is a trademark registered by InfluxData, which is not affiliated with, and does not endorse, TSDB for InfluxDB®.