Skip to Content
Hands-On Software Engineering with Golang
book

Hands-On Software Engineering with Golang

by Achilleas Anagnostopoulos
January 2020
Intermediate to advanced
640 pages
16h 56m
English
Packt Publishing
Content preview from Hands-On Software Engineering with Golang

Static and file-based scrape target configuration

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Software Architecture with Golang

Hands-On Software Architecture with Golang

Jyotiswarup Raiturkar

Publisher Resources

ISBN: 9781838554491Supplemental Content