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

Question:
Which of the following are recommended best practices for instrumenting applications with Prometheus?

  1. Use the default Prometheus metrics library
  2. Avoid using external or third-party libraries for instrumenting your application
  3. Use labels to provide context and differentiate between metric instances
  4. Expose metrics via HTTP endpoint in the /metrics path
Answer:
A, C, D - The default Prometheus metrics library is optimized for performance and is easy to use, making it a recommended choice for instrumenting your application.
Using labels is an important way to provide context for your metrics and to differentiate between metric instances.
Exposing metrics via HTTP endpoint in the /metrics path is a standard convention in the Prometheus ecosystem.
While it is generally best to use the default Prometheus metrics library, there may be cases where third-party libraries are necessary or desirable for certain use cases