美文网首页prometheus
Prometheus relabel_configs配置解释与通

Prometheus relabel_configs配置解释与通

作者: 续哥儿 | 来源:发表于2018-12-05 16:49 被阅读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没有找到办法替换

相关文章

网友评论

    本文标题:Prometheus relabel_configs配置解释与通

    本文链接:https://www.haomeiwen.com/subject/roswcqtx.html