← Concepts

阅读中文版本

Prometheus

Prometheus is a pull-based time-series monitoring system with a query language, built around multi-dimensional metrics and alerting.

observability

Definition

Prometheus is an open-source monitoring system that periodically scrapes HTTP endpoints exposing metrics in a text format, stores them as time series keyed by metric name and labels, and answers ad-hoc queries through PromQL. It pairs with Alertmanager for routing alerts and with exporters that publish metrics for systems that do not speak its protocol. Its dimensional model — every label combination is its own series — powers flexible aggregation and slicing.

Context and scope

The default metrics store for Kubernetes and cloud-native services, and the source of the data most SLO dashboards and rate alerts are built on.

Common misconceptions

  • Prometheus is push-based — it pulls by default; a push gateway exists only for short-lived jobs
  • More labels make metrics richer — every label combination multiplies series and can blow up cardinality and memory
  • Prometheus is a long-term store — local storage keeps weeks by default; long-term retention uses remote write

Anti-patterns

  • Labeling metrics with user ids or request ids, creating unbounded cardinality
  • Alerting on raw counters instead of rates computed over a window
  • Scraping hosts that are down as the only signal, missing partial failures

Related concepts

Related examples

Authoritative source

https://prometheus.io/docs/introduction/overview/

What it is

Prometheus discovers targets, scrapes an HTTP endpoint that returns metrics as plain text, and appends each sample to a time series identified by its name plus label set. PromQL then lets an operator slice and aggregate those series — per-pod, per-endpoint, per-status — and compute rates and ratios over sliding windows. Alerting rules evaluate PromQL expressions and fire through Alertmanager, which groups, silences, and routes notifications.

Why it matters

The dimensional model is what makes Prometheus powerful for infrastructure: the same metric can be broken down by any label without re-instrumenting. Pulling also makes target health visible — a failed scrape is itself a signal — and keeps the scrape cadence under the operator control. Combined with the wide exporter ecosystem, this makes it the lingua franca of cloud-native monitoring.

How to use it well

Keep label values bounded: per-user or per-request labels turn a few series into millions and exhaust memory. Expose counters and let rates be computed in queries, watch cardinality both in dashboards and in the metric itself, and use recording rules to precompute expensive expressions. Export the same metrics from every replica and aggregate away the replica label for service-level views.