1. 程式人生 > >將prometheus採集的資料遠端儲存到influxdb中

將prometheus採集的資料遠端儲存到influxdb中

這個比較簡單,

https://docs.influxdata.com/influxdb/v1.7/supported_protocols/prometheus

只需要更改prometheus.yaml配置 檔案。

    global:
      # 抓取的間隔時間
      scrape_interval: 20s
      # How long until a scrape request times out.
      scrape_timeout: 10s
      # 計算告警觸發條件的週期
      evaluation_interval: 20s
    # 告警規則檔案
    rule_files:
      - '/etc/prometheus-rules/*.rules'
    remote_write:
      - url: "http://xxxx:8086/api/v1/prom/write?db=prometheus"

    # remote_read:
    #   - url: "http://xxxx:8086/api/v1/prom/read?db=prometheus"