All Products
Search
Document Center

Lindorm:Use Prometheus to connect to and use LindormTSDB

Last Updated:Mar 28, 2026

When you need to store Prometheus metrics in a managed time series backend, LindormTSDB supports the standard Prometheus remote write and remote read protocols, so you can use it as a drop-in remote storage target. It also exposes built-in PromQL APIs that let you query data directly—without a separate Prometheus deployment—which is useful for tools like Grafana.

How it works

The integration relies on four HTTP endpoints, all sharing the same LindormTSDB HTTP base URL:

OperationEndpoint pathProtocol
Write metrics/api/v2/prom_write?db=<db_name>Prometheus remote write
Read metrics/api/v2/prom_read?db=<db_name>Prometheus remote read
PromQL instant query/api/v1/query?db=<db_name>Built-in PromQL
PromQL range query/api/v1/query_range?db=<db_name>Built-in PromQL

To find your LindormTSDB HTTP endpoint, see View endpoints.

Prerequisites

Before you begin, ensure that you have:

  • A LindormTSDB instance with HTTP access enabled

  • The LindormTSDB endpoint for HTTP (see View endpoints)

  • A running Prometheus instance (required for remote write and remote read; not required when using the built-in PromQL APIs directly)

Step 1: Create a database

Create a dedicated database to store Prometheus metrics. For the full syntax, see CREATE DATABASE.

CREATE DATABASE my_promdb;

Step 2: Configure Prometheus to write metrics to LindormTSDB

Add a remote_write entry to your prometheus.yml file. Set the db parameter to the database name you created in step 1. For more information about remote_write configuration options, see the Prometheus documentation.

# Without authentication
remote_write:
  - url: "<LindormTSDB endpoint for HTTP>/api/v2/prom_write?db=db_name"

# With authentication
remote_write:
  - url: "<LindormTSDB endpoint for HTTP>/api/v2/prom_write?db=db_name"
    basic_auth:
      username: <Username used to connect to LindormTSDB>
      password: <Password used to connect to LindormTSDB>

The following example uses a real endpoint:

remote_write:
  - url: "http://ld-bp1q343mws8q9****-proxy-tsdb.lindorm.rds.aliyuncs.com:8242/api/v2/prom_write?db=my_promdb"

Step 3: Query metrics from LindormTSDB

LindormTSDB supports two ways to query the metrics written by Prometheus.

Option 1: Built-in PromQL APIs

LindormTSDB provides built-in PromQL APIs that allow you to use PromQL to query data without the need to deploy additional Prometheus services. The query performance is higher than that when you use the remote data reading APIs of Prometheus.

This option works well when connecting Grafana or other PromQL-compatible tools directly to LindormTSDB.

Grafana configuration:

In Grafana, add a new Prometheus data source and set the following fields:

FieldValue
URLThe LindormTSDB endpoint for HTTP
Custom query parametersdb=my_promdb
Grafana data source configuration

Direct API access:

Call the PromQL endpoints directly. Set the db parameter to the database name created in step 1. For the full API specification, see the Prometheus expression query API documentation.

http://ld-bp1q343mws8q9****-proxy-tsdb.lindorm.rds.aliyuncs.com:8242/api/v1/query?db=my_promdb
http://ld-bp1q343mws8q9****-proxy-tsdb.lindorm.rds.aliyuncs.com:8242/api/v1/query_range?db=my_promdb

Option 2: Prometheus remote read

If LindormTSDB is connected to a self-managed Prometheus instance, configure remote read in your prometheus.yml to pull data through the standard Prometheus remote read protocol.

# Without authentication
remote_read:
  - url: "<LindormTSDB endpoint for HTTP>/api/v2/prom_read?db=db_name"

# With authentication
remote_read:
  - url: "<LindormTSDB endpoint for HTTP>/api/v2/prom_read?db=db_name"
    basic_auth:
      username: <Username used to connect to LindormTSDB>
      password: <Password used to connect to LindormTSDB>

The following example uses a real endpoint:

remote_read:
  - url: "http://ld-bp1q343mws8q9****-proxy-tsdb.lindorm.rds.aliyuncs.com:8242/api/v2/prom_read?db=my_promdb"