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

Question:
Which of the following instrumentation techniques can be used to monitor a Go application with Prometheus?

  1. Instrumenting HTTP handlers with the promhttp package
  2. Using the Go client library to expose custom metrics
  3. Using a third-party monitoring agent to scrape metrics
  4. Adding instrumentation to the application's code to emit metrics
Answer:
A, B, D - The promhttp package is the recommended way to instrument HTTP handlers in a Go application. The Go client library can be used to expose custom metrics from a Go application. Adding instrumentation to the application's code to emit metrics is a common approach for monitoring a Go application with Prometheus. While there may be third-party monitoring agents that can be used to scrape metrics from a Go application, using the default Prometheus instrumentation techniques is generally the recommended approach