_prometheus.mdx 1.3 KB
Newer Older
1
Configuring Prometheus is done by editing the Prometheus configuration file prometheus.yml (default location /etc/prometheus/prometheus.yml).
D
dingbo 已提交
2

3
### Configuring third-party database addresses
D
dingbo 已提交
4

5
Point the `remote_read url` and `remote_write url` to the domain name or IP address of the server running the taosAdapter service, the REST service port (taosAdapter uses 6041 by default), and the name of the database you want to write to TDengine, and ensure that the corresponding URL form as follows.
D
dingbo 已提交
6 7 8 9

- remote_read url : `http://<taosAdapter's host>:<REST service port>/prometheus/v1/remote_read/<database name>`
- remote_write url : `http://<taosAdapter's host>:<REST service port>/prometheus/v1/remote_write/<database name>`

10
### Configure Basic authentication
D
dingbo 已提交
11

12 13
- username: <TDengine's username>
- password: <TDengine's password>
D
dingbo 已提交
14

15
### Example configuration of remote_write and remote_read related sections in prometheus.yml file
D
dingbo 已提交
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

```yaml
remote_write:
  - url: "http://localhost:6041/prometheus/v1/remote_write/prometheus_data"
    basic_auth:
      username: root
      password: taosdata

remote_read:
  - url: "http://localhost:6041/prometheus/v1/remote_read/prometheus_data"
    basic_auth:
      username: root
      password: taosdata
    remote_timeout: 10s
    read_recent: true
```