Skip to main content...
Observability: Metrics, Logs, Traces
25 min

Day 99: Prometheus fundamentals: exporters, PromQL

Prometheus: pull-based metrics collection

Unlike systems where apps push metrics out, Prometheus pulls — it periodically scrapes an HTTP endpoint (/metrics) that each service exposes, storing everything as time series. An exporter is a small process that exposes metrics for something that doesn't natively speak Prometheus's format (a database, a queue, an OS).

What a /metrics endpoint actually looks like
http_requests_total{method="GET",path="/api/users",status="200"} 15234
http_request_duration_seconds_bucket{le="0.1"} 9821
http_request_duration_seconds_bucket{le="0.5"} 15100

Why pull instead of push

Pull-based collection means Prometheus itself controls scrape timing and can immediately tell if a target stops responding (a scrape failure is itself a signal) — and services don't need to know anything about where metrics are sent, they just expose an endpoint. This is a real, deliberate design trade-off, not an arbitrary choice.

PromQL

A few real PromQL queries
rate(http_requests_total[5m])                          -- requests/sec over the last 5 min
sum(rate(http_requests_total{status=~"5.."}[5m]))       -- total error rate across all instances
histogram_quantile(0.99, rate(http_request_duration_seconds_bucket[5m]))  -- p99 latency

Key terms

Exporter
A process exposing metrics in Prometheus's format for something that doesn't natively support it.
PromQL
Prometheus's query language for time series data.

Why does Prometheus's pull model make it easy to detect that a service has gone completely down?

We use cookies

We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies. Learn more

    Day 99: Prometheus fundamentals: exporters, PromQL | RBTechIconX