What Is Prometheus? Metrics Monitoring Explained
Prometheus is an open-source monitoring system that collects numeric metrics over time, stores them in a time-series database, and lets you query and alert on them.
Prometheus, originally built at SoundCloud and now a graduated CNCF project, is one of the most widely deployed metrics systems in cloud-native infrastructure. It defined a metrics format and query language that many other tools now speak. Understanding it is a good way to understand metrics-based monitoring in general.
The pull model
Unlike systems where applications push metrics to a collector, Prometheus scrapes them. It periodically fetches a plain-text metrics page exposed by each target over HTTP. This pull model makes targets simple to write, makes it obvious when a target is down (the scrape fails), and keeps the server in control of collection frequency.
Time series and labels
Prometheus stores every measurement as a time series identified by a metric name plus a set of key-value labels, such as a request count broken down by method and status code. Labels are what make the data sliceable, but they are also where cardinality problems start: too many label combinations explode the number of series.
PromQL
Queries are written in PromQL, a functional language for selecting and aggregating time series. With it you compute rates from counters, take percentiles from histograms, and aggregate across instances. PromQL is the engine behind both dashboards and alerting rules.
Alerting
Prometheus evaluates alerting rules written in PromQL and hands firing alerts to a companion component, Alertmanager, which handles grouping, deduplication, silencing, and routing to destinations like email, chat, or an on-call tool. This separation keeps alert evaluation and alert delivery cleanly distinct.
Prometheus in CI/CD
Teams commonly point Prometheus at the services a pipeline deploys, so post-deploy checks and canary analysis can query real metrics. Pipelines also push one-off metrics about a job, such as duration or test counts, through a Pushgateway, since short-lived CI jobs are not around long enough to be scraped.
Strengths and limits
Prometheus excels at reliable, real-time metrics and alerting on a single cluster. Its deliberate trade-offs include local storage and a focus on metrics rather than logs or traces, so teams often pair it with long-term storage backends and with logging and tracing tools to cover the other observability pillars.
Key takeaways
- Prometheus is an open-source, pull-based metrics monitoring system.
- It stores labeled time series and queries them with PromQL.
- Alertmanager handles routing and deduplication of its alerts.
- In CI/CD it backs post-deploy checks, canary analysis, and pipeline metrics.