This is my prometheus.yml, it works. The problem is I have hundreds servers and the yml file will be very long...
- targets: [ 'https://x.x.x.x/' ]
labels:
group: 'Infrastructure'
service: 'Git'
- targets: [ 'https://a.b.c.d/' ]
labels:
group: 'Infrastructure'
service: 'Database'
I try to merge them to 1 line but get error, is it possible? It's for readability and maintenance.
- targets: [ 'https://a.b.c.d/' ] labels: group: 'Infrastructure' service: 'Database'
Update: I'll change to the following format, it's more readable to main hundres targets.
[
{"targets":["https://x.x.x.x/"],"labels":{"group":"Infrastructure","service":"Git"}},
{"targets":["https://a.b.c.d/"],"labels":{"group":"Infrastructure","service":"Database"}}
]