prometheus.toml内容如下:
# # collect interval
# interval = 15
[[instances]]
#urls = [
# "http://localhost:19000/metrics"
#]
#url_label_key = "instance"
#url_label_value = "{{.Host}}"
#url_label_pair = {instance="{{.Host}}", alarmObject="{{.Host}}"}
## metrics duplication allowed, default false
# duplication_allowed=true
## Scrape Services available in Consul Catalog
[instances.consul]
enabled = true
agent = "http://127.0.0.1:8500"
query_interval = "1m"
[[instances.consul.query]]
name = "custom_exporter"
tag = "custom_exporter"
url = 'http://{{.ServiceAddress}}:{{.ServicePort}}/metrics'
[instances.consul.query.tags]
host = "{{.Node}}"
consul注册信息: