Prometheus

Prometheus is the de facto open-source standard for cloud-native metrics monitoring. It pulls (scrapes) numeric metrics from your applications and infrastructure at intervals, stores them as time series, and lets you query and alert on them with PromQL.

It's purpose-built for metrics — numbers over time like request rate, error rate, and latency — not for logs or traces. Paired with Alertmanager (routing alerts) and Grafana (dashboards), it forms the backbone of most open-source observability stacks.

TL;DR

Quick Example

A PromQL query computes the error rate from your request counter over a 5-minute window:

Core Concepts

Typical architecture

Best Practices

Common Mistakes

High-cardinality labels

Scraping too aggressively

FAQ

Why does Prometheus pull instead of push?

Pulling lets Prometheus control scrape timing, easily detect when a target is down (the scrape fails), and avoid apps needing to know where to send data. For short-lived jobs that can't be scraped, a Pushgateway bridges the gap, but pull is the default for good reasons.

What is PromQL?

Prometheus's query language for time series. It selects series by metric name and labels, then applies functions and aggregations — e.g. rate(...) for per-second rates and histogram_quantile(...) for percentiles. It's how you build dashboards and alert expressions.

Why are high-cardinality labels a problem?

Each unique label combination is a separate time series stored in memory. Unbounded labels (user IDs, request IDs, raw URLs) create millions of series, exhausting memory and storage. Keep labels bounded and low-cardinality.

Does Prometheus handle logs and traces?

No — it's metrics-only. Pair it with a log system (Loki, ELK) and a tracing system (OpenTelemetry + a backend) for full observability. Grafana can visualize all three together.

Related Topics

References