配置示例(带健康过滤)
配置示例(带健康过滤)
scrape_configs:
- job_name: 'consul-services'
consul_sd_configs:
- server: 'consul.example.com:8500'
services: ['order-api', 'pay-api']
relabel_configs:
- source_labels: [__meta_consul_service]
target_label: service默认只发现通过健康检查的实例;需要自行过滤时可使用 __meta_consul_health 标签。