PCA (Prometheus Certified Associate) sample exam question with answer 487
Question:
Which module of the Prometheus client library is used for creating custom collectors?
- prometheus_client.metrics
- prometheus_client.core
- prometheus_client.registry
- prometheus_client.parser
Answer:
C - is correct. The prometheus_client.registry module of the Prometheus client library is used for creating custom collectors. The CollectorRegistry class provided by this module allows you to register and manage your own metrics
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
D - is incorrect as the prometheus_client.parser module is used for parsing metric text data