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

Question:
Which of the following can be used to drop specific targets from a scrape?

  1. metric_relabel_configs with action keep
  2. metric_relabel_configs with action drop
  3. relabel_configs with action labeldrop
  4. relabel_configs with action keep
Answer:
D - While it may seem counterintuitive, action keep will drop all targets that do not match the regular expression and keep the ones that do. Check relabel_config and metric_relabel_config.
A, B - is incorrect as metric_relabel_configs affect metrics, not targets.
C - is incorrect as action labeldrop affects labels, not targets