在类型 config.plain 中未找到 prometheus 字段 remote_write

在类型 config.plain 中未找到 prometheus 字段 remote_write

我需要帮助使用 prometheus remote_write 和 remote_read 来访问/读取 influxdb。我收到以下错误:

# promtool check config /etc/prometheus/prometheus.yml
Checking /etc/prometheus/prometheus.yml
  FAILED: parsing YAML file /etc/prometheus/prometheus.yml: yaml: unmarshal errors:
  line 5: field remote_write not found in type config.plain
  line 7: field remote_read not found in type config.plain

这是我的 prometheus.yml

# head /etc/prometheus/prometheus.yml
---
global:
  scrape_interval: 60s
  evaluation_interval: 60s
  remote_write:
      - url: "http://192.168.0.10:8086/api/v1/prom/write?db=promtestdb&u=myuser&p=mypassword"
  remote_read:
      - url: "http://192.168.0.10:8086/api/v1/prom/read?db=promtestdb&u=myuser&p=mypassword"
scrape_configs:
- job_name: ldr

答案1

我的错了,按如下方式编辑 prometheus.yml 解决了这个问题!

# head /etc/prometheus/prometheus.yml
---
global:
  scrape_interval: 60s
  evaluation_interval: 60s
remote_write:
      - url: "http://192.168.0.10:8086/api/v1/prom/write?db=promtestdb&u=myuser&p=mypassword"
remote_read:
      - url: "http://192.168.0.10:8086/api/v1/prom/read?db=promtestdb&u=myuser&p=mypassword"
scrape_configs:
- job_name: ldr

相关内容