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

Question:
Which of the following is NOT a benefit of service discovery?

  1. As new service instances are spun up, they are monitored automatically
  2. As service instances are spun down, monitoring is automatically stopped
  3. In large environments, hundreds or thousands of targets do not need to be statically configured
  4. It is easier to tell and alert about a service not being deployed compared to static configuration of targets
Answer:
D - is the correct answer. This is not a benefit of service discovery because it is actually harder to tell if a service is not deployed when using service discovery compared with static configuration. For a statically configured target, a simple Prometheus query like up == 0 will alert when the given target is down or not deployed at all. With service discovery however, if a given service is not deployed, it will not be discovered and thus it will not even have an up metric associated with it. In this scenario, a Prometheus query leveraging the absent function is necessary with labels targeting the specific service. Then you would still need the up == 0 alerting rule which would alert when the service is deployed and discovered, but operationally down
A, B, C - this is a benefit of service discovery