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

Question:
What is the role of the generate_latest() function in a custom exporter?

  1. To generate a snapshot of the latest metrics collected by the exporter in the Prometheus exposition format
  2. To generate a summary of the latest metrics collected by the exporter in a non-standard format
  3. To generate a summary of the latest metrics collected by the exporter in the Prometheus exposition format
  4. To generate a summary of the latest metrics collected by the exporter in a format specified by the developer
Answer:
A - the generate_latest() function in a custom exporter is used to generate a snapshot of the latest metrics collected by the exporter in the Prometheus exposition format. This function can be used to serve the metrics on a web server of your choice