1. spring boot 2.x
1.1 配置prometheus
yaml
############## Spring Boot 2.x ##############
- job_name: 'consul_springboot'
metrics_path: '/actuator/prometheus'
scrape_interval: 5s
consul_sd_configs:
- server: '192.168.11.12:8500'
services: []
relabel_configs:
- source_labels: [__meta_consul_tags]
regex: .*springboot.*
action: keep
- regex: __meta_consul_service_metadata_(.+)
action: labelmap
############## Spring Boot 2.x ##############
- job_name: 'consul_springboot'
metrics_path: '/actuator/prometheus'
scrape_interval: 5s
consul_sd_configs:
- server: '192.168.11.12:8500'
services: []
relabel_configs:
- source_labels: [__meta_consul_tags]
regex: .*springboot.*
action: keep
- regex: __meta_consul_service_metadata_(.+)
action: labelmap