PCA (Prometheus Certified Associate) sample exam question with answer 373

Question:
How do you specify which targets Prometheus should scrape?

  1. On a per-job basis in the Prometheus configuration file via the static_configs and *_sd_configs attributes
  2. Globally via the --service-discovery command line argument
  3. Globally in the Prometheus configuration file via the static_configs and sd_configs attributes
  4. Globally via the --target command line argument
Answer:
A - is the correct answer. More at scrape_config
B, D - is incorrect as there is no such command line argument
C - is incorrect as targets are configured on a per-scrape job basis