In the prometheus
documentation, there is an example about service discovery using dns
, in which the following snippet should be added to the configuration file:
scrape_configs:
- job_name: 'myjob'
dns_sd_configs:
- names:
- 'telemetry.eu-west.api.srv.example.org'
- 'telemetry.us-west.api.srv.example.org'
- 'telemetry.eu-west.auth.srv.example.org'
- 'telemetry.us-east.auth.srv.example.org'
My question is whether a wildcard based pattern can be applied, in the likes of:
scrape_configs:
- job_name: 'myjob'
dns_sd_configs:
- names:
- '*.eu-west.api.srv.example.org'
If not, is the usage of an A record that resolves to all the IP addresses that need to be scraped (i.e. monitored by prometheus) the way around this?