Prometheus

Exporters & Instrumentation

Get metrics out of apps and third-party systems into the Prometheus exposition format.

Prometheus only scrapes HTTP endpoints in its exposition format, so two paths exist to produce them. Direct instrumentation uses a client library (Go, Java, Python, etc.) inside your code to define counters, gauges, and histograms and expose them on /metrics. This is the richest approach because the metrics reflect your domain — orders processed, queue depth, cache hits.

A universal travel adapter: your appliance (the database) has its own plug shape, and the exporter is the adapter that converts it to the standard socket Prometheus expects.

Key Concepts

1
For systems you cannot modify — databases, message brokers, the host OS, hardware — exporters act as adapters. An exporter (node_exporter for host metrics, plus exporters for MySQL, Redis, Kafka, etc.) talks to the target in its native protocol and re-exposes the data as Prometheus metrics. The four golden signals and the RED/USE methods guide which metrics to add: instrument latency, traffic, errors, and saturation rather than everything.
2
What the interviewer is probing.
What the interviewer is probing.
3
1. "What is an exporter for?" *Probing:* the purpose. *Stalls:* "Exporting." *Moves up:* translating a system that does not speak Prometheus — a database, a network device — into scrapeable metrics.
1. "What is an exporter for?"
4
2. "When do you write custom instrumentation instead?" *Probing:* judgement. *Stalls:* "Never." *Moves up:* for business and application-specific signals, which no generic exporter can know about.
2. "When do you write custom instrumentation instead?"
5
3. "What are the four metric types?" *Probing:* the breadth. *Stalls:* "Counters." *Moves up:* counter, gauge, histogram and summary — choosing wrongly, such as a counter for a value that decreases, makes the data meaningless.
3. "What are the four metric types?"
6
4. "What naming convention applies?" *Probing:* the detail. *Stalls:* "Any." *Moves up:* base unit suffixes and a total suffix for counters, such as http_requests_total and request_duration_seconds.
4. "What naming convention applies?"