模板
# cloud-primary-machine windows
- job_name: cloud-primary-machine-windows
scrape_timeout: 10s
consul_sd_configs:
- server: 'x.x.x.x'
services: []
relabel_configs:
- source_labels: [__meta_consul_tags]
regex: .*cloud-primary-machine-windows.*
action: keep
- regex: __meta_consul_service_metadata_(.+)
action: labelmap
# instance-oracle
- job_name: instance-oracle
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
file_sd_configs:
- files:
- sub_config/instance-oracle.yml
refresh_interval: 10m
# instance-redis
- job_name: 'instance-redis'
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
file_sd_configs:
- files:
- sub_config/instance-redis.yml
[root@iot-test-master-52-111 sub_config]# cat instance-redis.yml
- targets:
- x.x.x.x:9121
labels:
instance: redis-x.x.x.x:16379
role: redis-oa-v16
# instance-rocketmq
- job_name: instance-rocketmq
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
file_sd_configs:
- files:
- sub_config/instance-rocketmq.yml
refresh_interval: 10m
# kafka
- job_name: 'dingtalk-kafka'
static_configs:
- targets: ['x.x.x.x:9308']
labels:
instance: 'x.x.x.x0-1'
role: 'dingtalk-kafka-1'
# node-linux动态注册
- job_name: 'node-default'
consul_sd_configs:
- server: 'x.x.x.x6'
services: []
relabel_configs:
- source_labels: [__meta_consul_tags]
regex: .*node-default.*
action: keep
- regex: __meta_consul_service_metadata_(.+)
action: labelmap
# node
- job_name: 'pig2-node'
scrape_timeout: 10s
consul_sd_configs:
- server: 'x.x.x.x'
services: []
relabel_configs:
- source_labels: [__meta_consul_tags]
regex: .*pig2-node.*
action: keep
- regex: __meta_consul_service_metadata_(.+)
action: labelmap