I used consul template to generate the prometheus config file, and I set a key in Consul like this:
10.20.1.162:9100 env=test group=A project=t
10.20.1.160:9100 env=test group=A project=t
I want the output to look like this:
- targets:
- 10.20.1.162:9100
labels:
env: test
group: A
project: t
- 10.20.1.162:9100
labels:
env: test
group: A
project: t
In the example above, where we have env、 group、 project and any other labels, how can I set the template ?