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

Question:
Which module of the Prometheus client library is used for exposing metrics over HTTP?

  1. prometheus_client.metrics
  2. prometheus_client.core
  3. prometheus_client.registry
  4. prometheus_client.exposition
Answer:
D - correct answer. The prometheus_client.exposition module of the Prometheus client library is used for exposing metrics over HTTP. The start_http_server() function provided by this module allows you to start a web server that serves metrics on a specified port
A - is incorrect as the prometheus_client.metrics module contains pre-defined metric types
B - is incorrect as the prometheus_client.core module contains low-level classes and functions used by the other modules
C - is incorrect as the prometheus_client.registry module is used for creating custom collectors