January 2020
Intermediate to advanced
640 pages
16h 56m
English
Out of the box, Prometheus can be configured to leverage the native APIs offered by cloud providers such as AWS, GCE, Azure, and OpenStack to detect provisioned compute node instances and make them available as targets for scraping.
Each node discovered by Prometheus is automatically annotated with a series of provider-specific meta labels. These labels can then be referenced by operator-defined match rules to filter out any nodes that the operator is not interested in scraping.
As an example, let's say that we only want to scrape the EC2 instances that contain a tag with the name scrape and the value true. We can use a configuration block such as the following one to achieve this:
ec2_sd_configs: