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
原文地址:https://www.cnblogs.com/shhnwangjian/p/10666070.html