What Is Prometheus? How Prometheus Monitoring Works
What is Prometheus? It is an open source monitoring system that collects metrics with a pull model. Learn how it works, how PromQL and alerting run, and where its storage limits start.
Prometheus is an open source monitoring and alerting system that collects numeric metrics from your services and stores them as time series. It pulls data from targets over HTTP, keeps it in a local database and fires alerts when a rule matches.
It is the default metrics layer in most Kubernetes clusters and a core part of modern observability. Prometheus is simple to start with, but its storage, labels and alert rules need planning as you grow.
In this blog, you will:
Learn what Prometheus is and how its pull model collects and stores metrics.
See the four metric types and five PromQL queries on one example service.
Size Prometheus storage with a worked formula and learn where it falls short.
What Is Prometheus?
Prometheus is an open source systems monitoring and alerting toolkit. It records metrics as time series, which are numbers stored with the time they were recorded.
Each series also carries labels, which are key and value pairs such as the service name or the pod name. Labels let you slice the same metric many ways.
SoundCloud engineers built Prometheus in 2012. It joined the Cloud Native Computing Foundation in 2016 as its second hosted project after Kubernetes, and it graduated in 2018. Today no single company controls it.
We see three reasons it became the standard for cloud native metrics. It is free and runs as a single binary. Its label model matches the way Kubernetes labels workloads. Thousands of tools also expose metrics in its format already.
The project's biggest release in seven years, Prometheus 3.0, shipped in November 2024. It added a new web UI and support for UTF-8 metric and label names. It also added Remote Write 2.0 and native histograms, though both were still marked experimental at launch.
The release also made Prometheus a native receiver for OpenTelemetry metrics sent over OTLP. That matters because more teams now instrument new code with OpenTelemetry first.
Prometheus handles metrics only. It doesn't store logs or traces, and it isn't a full dashboard tool. Most teams pair it with other tools for those jobs, which we cover later.
How Does Prometheus Monitoring Work?
Prometheus uses a pull model. The server reaches out to each target on a schedule and reads its current metrics over HTTP. We'll follow a fictional checkout service that runs as three pods in one Kubernetes cluster to show each step.
1. Expose metrics: The checkout code uses a Prometheus client library to count requests and time each one. The library serves the current values as plain text on a /metrics page. Software you can't change, such as a database or a Linux host, uses an exporter. An exporter is a small program that translates those stats into the same format.
2. Discover targets: Prometheus asks the Kubernetes API which pods exist and which ones carry the checkout label. When we scale to a fourth pod, Prometheus adds it on the next discovery cycle with no config change.
3. Scrape on a schedule: At every scrape interval, Prometheus requests the /metrics page from each pod. The default interval is one minute, and many teams set it to 15 seconds. Each value it reads becomes a sample with a timestamp.
4. Store samples locally: Samples land in a local time series database on disk. Prometheus groups them into two-hour blocks and keeps them for 15 days by default.
5. Evaluate rules: Prometheus runs recording rules, which save the result of a query as a new series. It also runs alert rules, which check a condition. Firing alerts go to Alertmanager, which sends the notification.

Short-lived jobs break the pull model, because a batch job may finish before the next scrape. For those, the job pushes its final metrics to a Pushgateway, and Prometheus scrapes the gateway instead.
Prometheus Architecture: Core Components
The steps above map to a handful of components. Only the server is required, but we'd add node exporter and Alertmanager on day one.
Component | What It Does | When You Need It |
|---|---|---|
Prometheus server | Discovers targets, scrapes them, stores samples and runs rules | Always |
Client libraries | Add metrics to your own code in Go, Java, Python and other languages | For services you build |
Exporters | Translate stats from third-party software into the Prometheus format | For databases, proxies and network gear |
Node exporter | Exposes CPU, memory, disk and network metrics for Linux and Unix hosts | For every server you run |
Pushgateway | Holds metrics pushed by batch jobs until the next scrape | For short-lived jobs |
Alertmanager | Groups, routes and silences alerts | Once you alert on metrics |
Remote write | Sends a copy of samples to long-term storage | When you need more than local retention |
In Kubernetes, node exporter usually runs on every node, with cAdvisor for container metrics and kube-state-metrics for object status.
Together, these three sources cover most of what Kubernetes monitoring needs at the cluster level.
Prometheus Metric Types and PromQL
Every Prometheus metric has a name, a set of labels and a type. The type tells you which queries make sense.
The Four Prometheus Metric Types
Type | What It Tracks | Checkout Example |
|---|---|---|
Counter | A total that only goes up and resets to zero on restart | http_requests_total, the number of requests served |
Gauge | A value that can rise and fall | checkout_queue_depth, the orders waiting right now |
Histogram | Counts of observations in set buckets, plus a sum and a count | http_request_duration_seconds, request time per bucket |
Summary | Quantiles calculated in the app over a sliding window | Older code that reports a precomputed 99th percentile |
We default to histograms for latency. You can add histograms from many pods together and calculate one percentile across all of them.
Summary quantiles from separate pods can't be combined that way. Native histograms go further, because they set bucket edges for you and cost less to store.
What Is PromQL?
PromQL is the Prometheus query language. It selects series by name and label, then applies functions such as rate or sum. These five queries answer common questions about the checkout service:
Question | PromQL Query |
|---|---|
How many requests per second does checkout serve? | sum(rate(http_requests_total{service="checkout"}[5m])) |
Which pod is the busiest? | sum by (pod) (rate(http_requests_total{service="checkout"}[5m])) |
What share of requests fail? | sum(rate(http_requests_total{service="checkout",status=~"5.."}[5m])) / sum(rate(http_requests_total{service="checkout"}[5m])) |
How slow is the slowest 1% of requests? | histogram_quantile(0.99, sum by (le) (rate(http_request_duration_seconds_bucket{service="checkout"}[5m]))) |
Which hosts will run out of disk within four hours? | predict_linear(node_filesystem_avail_bytes[1h], 4 * 3600) < 0 |
We follow two habits that prevent most PromQL mistakes. Always wrap a counter in rate before you graph it, because the raw total only climbs. Also use a range of at least four times your scrape interval, so each window holds enough samples.
The five queries cover traffic, errors, latency and saturation, which are the four golden signals of service health.
How Does Prometheus Alerting Work?
Prometheus splits alerting into two jobs. The server decides when a condition is true. Alertmanager decides who hears about it and how often.
An alert rule pairs a PromQL expression with a for duration. For checkout, we might alert when the error share from the table above stays over 2% for 10 minutes. The for clause stops a single bad scrape from paging anyone. While the condition holds but the 10 minutes haven't passed, the alert waits in a pending state.
Alertmanager then handles the noise. It groups related alerts, so 30 failing pods send one notification. Silences mute alerts during planned work. Inhibition hides smaller alerts while a bigger one fires, such as pod alerts during a full cluster outage. We find these controls go a long way toward preventing alert fatigue.
Static thresholds have a weak spot, though. A fixed 2% limit fits a busy weekday. It may miss trouble on a quiet weekend, when we'd expect almost no errors at all. Baseline alerts compare each value to a range learned from the metric's own history, so the limit moves with normal patterns.
In PromQL, you can get close by comparing the current rate with the same period last week through the offset modifier. In ObserveOps, a baseline metric policy builds that range from the last 15 days of data.
What Are the Storage and Scaling Limits of Prometheus?
The main limits of Prometheus are local storage, the capacity of a single server and its focus on metrics only. Storage is usually the first one teams hit. We plan it early so the disk doesn't fill up during an incident, when you need the data most.
How Much Storage Does Prometheus Need?
The Prometheus storage documentation gives a rough formula. Needed disk space equals retention time in seconds, times samples ingested per second, times bytes per sample.
Prometheus stores 1 to 2 bytes per sample on average. Samples per second equal your active series divided by the scrape interval.
We used 2 bytes per sample in this table to stay on the safe side:
Setup | Active Series | Scrape Interval | Retention | Samples per Second | Disk Needed | Disk to Provision |
|---|---|---|---|---|---|---|
Small | 50,000 | 30 s | 15 days | About 1,700 | About 4.3 GB | About 5.4 GB |
Medium | 500,000 | 15 s | 15 days | About 33,000 | About 86 GB | About 108 GB |
Large | 2,000,000 | 15 s | 30 days | About 133,000 | About 691 GB | About 864 GB |
The last column follows another tip from the same documentation. Set the retention size limit to no more than 80 to 85% of the disk, because compaction briefly needs extra space. We divided the disk needed by 0.8 to get it.
Labels drive the series count. We'll take the checkout latency histogram, which has 10 buckets. With its sum and count, it creates 12 series for each label set.
Across 5 endpoints, 4 status codes and 3 pods, that adds up to 720 series. Add a user ID label with 10,000 values, and it becomes 7.2 million series. That one metric would outgrow the large setup above.
This is the core problem behind high cardinality metrics, and it's why IDs never belong in labels.
Memory grows with the series count too, since recent data stays in memory until each two-hour block is written. The docs note that cutting series saves more than a longer scrape interval, because samples within one series compress well.
Where Prometheus Falls Short
Prometheus is reliable by design. Each server stands alone, so it keeps working when other systems fail. That same design sets its limits:
Local storage isn't replicated: A disk or node failure can lose data, so high availability means running two identical servers.
One server has a ceiling: Large estates split the work across several servers by team or cluster, which spreads data across many places.
Long-term history needs extra parts: Teams add remote write to tools such as Thanos or Grafana Mimir for months of data and a global view.
It isn't exact: A failed scrape can drop samples, so the project itself advises against using Prometheus for per-request billing.
It covers metrics only: Logs and traces need separate tools, and linking them to a metric spike is manual work.
We still see older guides that say Prometheus has no TLS or authentication. That changed in version 2.24 in January 2021, which added TLS and basic authentication through a web config file.
It still has no built-in role-based access, so most teams put a proxy or a managed service in front of it.
How Prometheus Fits With Grafana and OpenTelemetry
Grafana is the usual dashboard layer. It reads from Prometheus as a data source and runs PromQL behind each panel. Prometheus has its own basic graph view, but we'd build team dashboards in Grafana.
OpenTelemetry is a vendor-neutral standard for producing metrics, logs and traces. Since version 3.0, Prometheus can receive OpenTelemetry metrics directly over OTLP. Many teams now instrument code with OpenTelemetry and keep Prometheus as the metrics store.
Traces then go to a separate backend. Jaeger tracing is a common open source choice for that job.
Unify Metrics, Logs and Traces With Motadata ObserveOps
Prometheus gives you a free and proven way to collect and query metrics. Its pull model, label-based data and PromQL make it a natural fit for Kubernetes and microservices.
The harder work comes later, as labels multiply, storage fills and alerts need context from logs and traces. We suggest sizing storage before you scale, keeping IDs out of labels and alerting on error share and latency, not raw counts.
When one metrics store is no longer enough, ObserveOps brings metrics, logs, traces and baseline alerts into one unified observability and ITSM platform. Your team can see a latency spike next to the slow traces and error logs behind it. That shortens the path from alert to cause.
FAQs
Is Prometheus free to use?
Prometheus is free and open source under the Apache 2.0 license. The server, Alertmanager and official exporters cost nothing. You still pay for the servers, disks and engineering time needed to run it, back it up and scale it.
How long does Prometheus keep data?
Prometheus keeps data for 15 days by default. You can change this with a time-based or size-based retention setting. For months or years of history, most teams send a copy of their samples to long-term storage through remote write.
Does Prometheus use push or pull?
Prometheus mainly pulls. The server scrapes each target's metrics page over HTTP on a fixed schedule. Short-lived batch jobs can push to a Pushgateway, and since version 3.0, Prometheus can also receive OpenTelemetry metrics pushed over OTLP.
Can Prometheus store logs or traces?
Prometheus stores numeric metrics only. Logs need a log platform such as Loki or Elasticsearch, and traces need a tracing backend such as Jaeger or Tempo. Exemplars can attach a trace ID to a metric sample to link the two.
Is Prometheus a time series database?
Prometheus includes its own local time series database, but it is more than a database. It also discovers targets, scrapes metrics, runs PromQL queries and evaluates alert rules, which a plain database doesn't do.
Author
Ramya Shah
Technical Writer
Ramya Shah is a technical content writer with a computer engineering background and roots in automotive journalism. He covers IT Service Management, observability, IT operations, and AI-driven automation. An early adopter of AI-assisted writing workflows, he turns complex IT processes into clear, engaging content optimized for search and answer engines (AEO), lifting content output and organic visibility.
![7 Best Tracing Tools in 2026 [Compared & Ranked]](https://www.motadata.com/storage/blog/featured-images/tracing-tools-hero.webp)
![8 Best Windows Monitoring Tools in 2026 [Compared and Ranked]](https://www.motadata.com/storage/blog/featured-images/windows-monitoring-tools-hero.webp)
![8 Best SNMP Monitoring Tools [Compared in 2026]](https://www.motadata.com/storage/blog/featured-images/snmp-monitoring-tools-hero.webp)