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

Question:
Which of the following methods can be used to expose metrics in a custom Prometheus exporter? Select all that apply.

  1. Using the Prometheus client library to create and register metrics
  2. Parsing log files to extract relevant metrics
  3. Using SNMP to query network devices for relevant metrics
  4. Writing metrics to a file or database and using a separate program to expose them
Answer:
A, B, D - are the correct answers. There are several methods that can be used to expose metrics in a custom Prometheus exporter, but using the Prometheus client library to create and register metrics is the most common approach. Parsing log files or writing metrics to a file or database and using a separate program to expose them can also be effective
C - is incorrect. Reading metrics from an existing monitoring system or using SNMP is less common and may require additional configuration or setup