prometheus

Prometheus relabel_configs配置解释与通

2018-12-05  本文已影响0人  续哥儿
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['localhost:9090']

  - job_name: 'fileds'  
    file_sd_configs:  #通过文件去动态发现配置
    - refresh_interval: 1m #默认5分钟检查一次
      files:
       - targets.json #配置文件路径
#    relabel_configs:
#         - source_labels: [host]
#           target_label: job
#把host这个label变量的的值赋值给instance
#      - source_labels: [host]
#        target_label: instance
#改变instance的值为host这个字符串
#      - target_label: instance
#        replacement: host
#在client中自定义的label没有找到办法替换
上一篇 下一篇

猜你喜欢

热点阅读