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

Question:
Which Prometheus relabeling configuration can be used to scrape a subset of all discovered targets for a job via modulo division?

  1. One relabel_config with action modulus
  2. One relabel_config with action hashmod
  3. Two relabel_configs, one with action hashmod and the other with action keep or drop
  4. Two relabel_configs, one with action modulus and the other with action keep or drop
Answer:
C - is correct answer
A - is incorrect as there is no such action modulus
B - is incorrect as action hashmod writes the target's modulus to a label. A follow-up relabel_config must be added that either keeps or drops targets with that specific modulus
D - is incorrect as there is no such action modulus. The proper action for this scenario is called hashmod