#prometheus #remote #td-engine #table-column #blm

bin+lib bailongma

Official Prometheus Remote Storage Adapter for TDengine

7 releases

0.2.4 Jan 5, 2022
0.2.3 Jun 8, 2021
0.1.1 Jun 4, 2021

#1974 in Command line utilities

24 downloads per month

MIT and GPL-3.0-only

76KB
2K SLoC

Bailongma

TDengine adatper for Prometheus, and others will happen soon.

For simple use case, just run:

bailongma

For all options, type --help for details.

Long usage here:

TDengine adapter for prometheus

USAGE:
    bailongma [OPTIONS]

FLAGS:
        --help
            Prints help information

    -V, --version
            Prints version information


OPTIONS:
    -c, --chunk-size <chunk-size>
            Sql chunk size.
            
            The larger your table column size is, the small chunk should be setted. [default: 600]

    -h, --host <host>
            TDengine host IP or hostname [default: localhost]

    -l, --level <level>
            Debug level [default: info]

    -L, --listen <listen>
            Listen to an specific ip and port [default: 0.0.0.0:10203]

    -C, --max-connections <max-connections>
            Max TDengine connections
            
            - in concurrent cases, use max as 50000 - for common use, set it as 5000 [default:
            50000]

    -M, --max-memory <max-memory>
            Max memroy, unit: GB [default: 50]

    -P, --password <password>
            TDengine password [default: taosdata]

    -p, --port <port>
            TDengine server port [default: 6030]

    -u, --user <user>
            TDengine user [default: root]

    -w, --workers <workers>
            Thread works for web request [default: 10]

Example:

bailongma -h tdengine -p 6030 -u root -P taospass --listen 0.0.0.0:10101

It will listen to port 10101(default is 10230).

Configure in prometheus.yml:

remote_write:
  - url: "localhost:10101/adapters/prometheus/write"
remote_read:
  - url: "localhost:10101/adapters/prometheus/read"

The default database is prometheus, use query option database to modify this, configuration file is like:

remote_write:
  - url: "localhost:10101/adapters/prometheus/write?database=prom1"
remote_read:
  - url: "localhost:10101/adapters/prometheus/read?database=prom1"

Build and Install

cargo build
cargo install --path .

blm-bench-prom

cargo build will also produce a benchmark tool.

blm-bench-prom http://127.0.0.1:10230/adapters/prometheus/test5 \
  --points 10 \
  --metrics 10 \
  --interval 1000 \
  --chunks 1000 \
  --samples 100

Dependencies

~32–50MB
~897K SLoC