prometheus 基于DNS的目标发现

prometheus 基于DNS的目标发现

DNS服务发现依赖于查询A、AAAA或SRV DNS记录。

1、基于 SRV 记录发现

scrape_configs:
  - job_name: 'webapp'
  dns_sd_configs:
    - names: [‘_prometheus._tcp.shhnwangjian.com]

注意:_prometheus 为服务名称,_tcp 为协议, xiodi.cn 为域名

2、基于 A 记录

- job_name: 'webapp'
  dns_sd_configs:
    - names: [ 'ops.shhnwangjian.cn']
      type: A
      port: 9090

 

posted @ 2019-04-07 17:18  shhnwangjian  阅读(1514)  评论(0编辑  收藏  举报