I'm going through the "getting started" tutorial for Prometheus. I'm getting very hung up on the YAML config file:
scrape_configs:
- job_name: 'node'
# Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 5s
static_configs:
- targets: ['localhost:8080', 'localhost:8081']
labels:
group: 'production'
- targets: ['localhost:8082']
labels:
group: 'canary'
So apparently hyphens are supposed to indicate one of two things: The first item in a new list, or a key value pair.
So it looks like
job_name: 'node'is a key value pair. Why then is everything after it indented?targetsalso looks like a key value pair. But so doeslabelsand it doesn't have a hyphen. Further,groupis indented by one space fromlabels.
It's very, very difficult for me to tell what is going on here. I need to know if I am ever going to customize this file (which I already tried to do and received errors when starting up Prometheus).
What is the logical structure of this file?