PCA practice question 15 of 15

What is the difference between client libraries and exporters?

Full set: 60 questions
Answer options
A: Exporters are written in Go. Client libraries are written in many languages.
B: Exporters expose metrics for scraping. Client libraries push metrics via Remote Write.
C: Exporters run next to the services to monitor, and use client libraries internally. Correct answer
D: Exporters and client libraries mean the same thing.
Correct Answer:
C. Exporters run next to the services to monitor, and use client libraries internally.
Explanation

The fundamental difference lies in their application. Client libraries are used to add instrumentation directly into the source code of an application you control, allowing it to expose its own internal state as Prometheus metrics. In contrast, an exporter is a standalone application that runs alongside a target service that cannot be directly instrumented (e.g., a database, OS kernel, or third-party software). The exporter collects metrics from the target service and then uses a Prometheus client library internally to translate and expose these metrics in the Prometheus format for scraping.

Why Incorrect

A. While many official exporters are written in Go, they can be written in any language. The defining characteristic is function, not the programming language used for implementation.
B. Both applications instrumented with client libraries and exporters expose metrics via an HTTP endpoint for Prometheus to scrape (pull). Remote Write is a mechanism for pushing metrics from a Prometheus server, not to it from a client.
D. They are distinct concepts serving different use cases: direct instrumentation of your own code (client library) versus indirect monitoring of a third-party system (exporter).

References

1. Prometheus Official Documentation, "Exporters and integrations": "There are a number of libraries and servers which help in exporting existing metrics from third-party systems as Prometheus metrics. This is useful for cases where it is not feasible to instrument a given system with Prometheus metrics directly..." This establishes the role of exporters for third-party systems.

Source: Prometheus Authors. (n.d.). Exporters and integrations. Prometheus.io. Retrieved from https://prometheus.io/docs/instrumenting/exporters/ (Section: Introduction).

2. Prometheus Official Documentation, "Client libraries": "Prometheus client libraries are available for various languages. Use these to add instrumentation to your code." This defines the role of client libraries for direct code instrumentation.

Source: Prometheus Authors. (n.d.). Client libraries. Prometheus.io. Retrieved from https://prometheus.io/docs/instrumenting/clientlibs/ (Section: Introduction).

3. University of Washington, CSE 481D Courseware, "Monitoring & Alerting": "For applications you can't instrument directly, you can use an exporter. An exporter is a separate process that scrapes metrics from an application and exposes them to Prometheus." This corroborates the distinction and use case for exporters.

Source: Tom Anderson. (2020). Lecture 15: Monitoring & Alerting. University of Washington, Paul G. Allen School of Computer Science & Engineering. Page 15. Retrieved from https://courses.cs.washington.edu/courses/cse481d/20sp/lectures/15-monitoring.pdf.

Scroll to Top