January 2020
Intermediate to advanced
640 pages
16h 56m
English
A static scrape configuration is considered the canonical way of providing scrape targets to Prometheus. The operator includes one or more static configuration blocks in the Prometheus configuration file that define the list of target hosts to be scraped and the set of labels to apply to the scraped metrics. You can see an example of such a block in the following code:
static_configs: - targets: - "host1" - "host2" labels: service: "my-service"
An issue with the static config approach is that after updating the Prometheus configuration files, we need to restart Prometheus so it can pick up the changes.
A better alternative is to extract the static configuration blocks to an external file ...