What are exporters in Prometheus and how do node_exporter and others work?
Learn what Prometheus exporters are, how node_exporter and others expose metrics on /metrics, and how the pull model scrapes them, with a config example.
Expected Interview Answer
Exporters are small programs that collect metrics from a system or third-party service and expose them in Prometheus's text format over an HTTP /metrics endpoint, so Prometheus can scrape them. They act as translators for software that cannot speak Prometheus natively.
Prometheus works on a pull model: it periodically scrapes HTTP endpoints for metrics. Many systems — Linux hosts, databases, message queues — do not expose Prometheus-format metrics themselves, so an exporter sits beside them, gathers their internal statistics, and republishes them as Prometheus metrics. node_exporter runs on a host and exposes CPU, memory, disk, and network stats; other exporters like mysqld_exporter, blackbox_exporter, and cAdvisor do the same for databases, endpoints, and containers.
- Bridges systems that lack native Prometheus support
- Standardizes metrics into one scrapeable format
- Decouples monitoring from application code
- Reuses a large ecosystem of ready-made exporters
- Enables host, database, and blackbox monitoring uniformly
AI Mentor Explanation
Think of an exporter as a scorer who watches a match played in a foreign notation and rewrites the runs and wickets into the standard scorecard everyone understands. The players never change how they play; the scorer simply translates the game into a common sheet so the league office can read every match the same consistent way.
Step-by-Step Explanation
Step 1
Identify the target
Find the system to monitor — a host, database, or endpoint — that lacks native Prometheus metrics.
Step 2
Deploy the exporter
Run the matching exporter (node_exporter, mysqld_exporter, blackbox_exporter) next to or against that target.
Step 3
Expose /metrics
The exporter gathers internal stats and serves them in Prometheus text format on an HTTP port.
Step 4
Configure scraping
Add the exporter's host:port as a target in prometheus.yml so Prometheus pulls it at each scrape interval.
Step 5
Query and alert
Use PromQL on the exported metrics to build dashboards and alerting rules.
What Interviewer Expects
- Definition of an exporter as a metrics translator
- Understanding of the pull model and the /metrics endpoint
- Knowledge that node_exporter reports host-level metrics
- Examples of other exporters and what they cover
- How exporters are registered as scrape targets
Common Mistakes
- Thinking Prometheus scrapes systems directly without an exporter
- Confusing exporters with the pushgateway
- Running node_exporter inside a container and reporting container, not host, metrics
- Not securing or firewalling the exposed /metrics endpoint
Best Answer (HR Friendly)
“An exporter is a small helper program that reads statistics from a system and republishes them in the format Prometheus understands. For example, node_exporter runs on a server and reports its CPU, memory, and disk usage, so Prometheus can collect and chart that data.”
Code Example
scrape_configs:
- job_name: 'node'
static_configs:
- targets: ['localhost:9100']
# node_exporter exposes host metrics at http://localhost:9100/metricsFollow-up Questions
- What is the difference between an exporter and the pushgateway?
- How does blackbox_exporter probe endpoints?
- Why does Prometheus use a pull model instead of push?
- How do you write a custom exporter?
- What metrics does node_exporter expose by default?
MCQ Practice
1. What is the main job of a Prometheus exporter?
An exporter collects a system's metrics and exposes them in Prometheus text format for scraping.
2. Which exporter reports host CPU, memory, and disk metrics?
node_exporter runs on a machine and exposes operating-system and hardware-level metrics.
3. On which default port does node_exporter serve metrics?
node_exporter exposes its /metrics endpoint on port 9100 by default.
Flash Cards
What is a Prometheus exporter? — A program that collects a system's metrics and exposes them in Prometheus format on /metrics.
What does node_exporter do? — Runs on a host and exposes CPU, memory, disk, and network metrics on port 9100.
Why are exporters needed? — Many systems can't expose Prometheus-format metrics natively, so exporters translate for them.
How does Prometheus get exporter data? — It scrapes the exporter's HTTP /metrics endpoint on each scrape interval (pull model).
Continue Learning
Related Interview Questions
How do you monitor something that cannot expose /metrics — an external endpoint, a certificate, or a shell script's output?
hard
What is Prometheus and what problems does it solve in monitoring?
easy
What is the difference between push and pull metric collection?
medium
What are labels in Prometheus and why are they powerful?
easy