Cloud VPS from $1.98/mo · pay with Bitcoin, Ethereum, Monero, USDT or Solana · paid in crypto
DevOps

Prometheus vs Grafana: roles, sizing and when to self-host

Prometheus vs Grafana explained: who collects, stores, alerts and draws what, how to size disk with the official formula, and when a lighter tool fits better.

CloudSat teamNovember 18, 20267 min read
Streams of tiny points flowing into a glowing cylinder and rising out of it as smooth curved graph lines
On this pageWho does what

"Prometheus or Grafana?" is a question with a short answer: both, because they do different jobs. Prometheus collects metrics, stores them and decides when something deserves an alert. Grafana draws dashboards from Prometheus and from dozens of other data sources. The decision that deserves more thought is whether you want to run Prometheus yourself, and what that costs in disk, memory and attention.

As of November 2026, Prometheus is on the 3.x line (3.16 is current) under the Apache 2.0 license, as a graduated Cloud Native Computing Foundation project. Grafana is on 13.x and is licensed AGPL-3.0 by Grafana Labs.

Who does what

Job Prometheus Grafana
Collect Scrapes HTTP endpoints on a schedule Collects nothing; queries sources when a panel loads
Store Its own time-series database on local disk Dashboards, users and settings, not metric data
Query PromQL Each source's own language, PromQL for Prometheus
Alert Rules evaluated in Prometheus, notifications sent by Alertmanager Grafana-managed rules over any source, with contact points
Visualize A basic graph and table view Dashboards, variables, annotations and sharing
Sources Only its own data Prometheus, Loki, PostgreSQL, MySQL, Elasticsearch, InfluxDB and many more

You can run Prometheus without Grafana, with alerts and the built-in query page as your only interface. You can run Grafana without Prometheus, on top of a SQL database or a logging system. The pair is popular because each fills the other's gap.

How Prometheus gets its data

Prometheus pulls. Every target exposes a /metrics page in a plain text format, and Prometheus fetches it at a fixed interval, often 15 or 30 seconds. Targets come from three places:

  • Exporters translate a system into metrics: node_exporter for Linux hosts on port 9100, windows_exporter for Windows, blackbox_exporter for probing HTTP, TCP, DNS or ICMP from the outside, plus exporters for databases, web servers and queues.
  • Client libraries let your own code publish counters, gauges and histograms.
  • Service discovery finds targets from static lists, files, DNS, cloud APIs, Docker or Kubernetes, so new servers appear without editing the config by hand.

Pull has consequences you should plan for. Prometheus must be able to reach every target, so firewalls need a rule from the monitoring server to each exporter port, and those ports must never be open to everyone. In exchange, every scrape produces an up metric for free, and up == 0 is the most useful alert you will ever write.

Pushing is possible where pulling is awkward. Short batch jobs can report to a Pushgateway, and Prometheus 3 can accept pushed data through its remote-write receiver or an OpenTelemetry (OTLP) receiver, enabled with --web.enable-otlp-receiver.

Labels: the cost you do not see coming

A series is a metric name plus one unique combination of label values. http_requests_total{method="GET", status="200", path="/login"} is one series; change any label value and you have another. Memory and disk grow with the number of active series, not with the number of metrics.

That makes label choice the main cost lever. Labels with a few fixed values (status code, method, region) are cheap. Labels with unbounded values, such as user IDs, email addresses, full URLs with query strings or request IDs, multiply the series count until the server runs out of memory. Keep those in logs or traces.

Two places show where series come from: the prometheus_tsdb_head_series metric, which counts active series, and the TSDB status page in the Prometheus web interface, which ranks metric names and labels by how many series they create.

Sizing disk and memory

The Prometheus documentation gives a capacity formula for disk:

needed_disk_space = retention_time_seconds * ingested_samples_per_second * bytes_per_sample

It also states that Prometheus stores an average of only 1 to 2 bytes per sample after compression. A worked example with assumed numbers:

Input Value
Servers 20
Series per server (assumed) 1,500
Scrape interval 15 seconds
Samples per second 30,000 ÷ 15 = 2,000
Retention 30 days = 2,592,000 seconds
Disk at 2 bytes per sample about 10.4 GB

Measure your own series count before you trust the estimate, and leave headroom for the write-ahead log and compaction. Retention defaults to 15 days. Set --storage.tsdb.retention.time for the period you want and --storage.tsdb.retention.size as a safety cap, which deletes the oldest blocks first.

Memory has no comparable formula. It follows active series and query load, so watch process_resident_memory_bytes for Prometheus itself as you add targets, and give heavy dashboards their own recording rules. Two storage rules are not negotiable: use a local disk, because the documentation says NFS is not supported and non-POSIX file systems can corrupt data, and remember that local storage is neither clustered nor replicated.

What happens when Prometheus is down

Two things, both quiet. Targets are not scraped, so the gap in your graphs is permanent: pulled data that was never collected cannot be fetched later. Rules are not evaluated, so no alert fires, and a dead monitoring server looks exactly like a healthy fleet.

Plan for it in layers:

  1. A dead man's switch. Define an alert that always fires and route it to an external heartbeat service that raises the alarm when the alert stops arriving.
  2. Outside-in checks. A separate uptime monitor, such as Uptime Kuma on another server, notices when sites fail even if Prometheus is gone.
  3. A pair. Two identical Prometheus servers scraping the same targets give you redundancy, and clustered Alertmanagers deduplicate the notifications.
  4. Long-term storage. Remote write to Thanos, Grafana Mimir or VictoriaMetrics keeps history beyond one disk and one server.

Grafana's side of the stack

Grafana is where people actually look. Import a community dashboard by its ID to get a full host overview in a minute, then build your own panels for the services you run. Variables turn one dashboard into a view per server or per environment.

Treat Grafana's configuration as code. Data sources and dashboards can be provisioned from YAML and JSON files, so a rebuilt server comes back identical and changes go through review. Grafana keeps users and settings in SQLite by default; move to PostgreSQL or MySQL when several Grafana instances must share state.

Alerting can live in either tool. Prometheus rules with Alertmanager are the traditional route and survive a Grafana outage. Grafana-managed rules can combine sources, for example a metric and a SQL query, and send to the same chat and email contact points. Pick one home per alert so nobody gets paged twice.

When to self-host Prometheus, and when not

Self-hosting pays off when you run several servers or services, want PromQL-based alerting, prefer metrics to stay on machines you control, and have someone who will patch and back it up. Prometheus and Grafana are both one-click apps on CloudSat, and the Docker Compose walkthrough builds the same pair by hand.

A lighter tool is often the better choice:

  • One or two servers, graphs wanted: Netdata or Beszel show host metrics with almost no configuration.
  • Classic agent-based monitoring, Windows hosts or SNMP devices: Zabbix covers them in one product, as the guide to self-hosted Windows monitoring explains.
  • Long retention or very many series: VictoriaMetrics accepts Prometheus remote write and answers PromQL-style queries through its MetricsQL dialect.
  • Nobody to own it: a hosted monitoring service costs money but does not page you about itself.

FAQ

Do I need Alertmanager if I use Grafana alerting?

Only for alert rules evaluated by Prometheus. Prometheus decides that an alert is firing, but it hands delivery, grouping and silencing to Alertmanager. Grafana-managed rules send notifications on their own.

Can Prometheus store logs or traces?

No. It stores numeric time series only. Logs belong in a system such as Loki or VictoriaLogs and traces in Tempo or Jaeger, all of which Grafana can display next to your metrics.

Is Prometheus agent mode useful on small servers?

Yes, for edge machines. Started with --agent, Prometheus scrapes local targets and forwards everything by remote write without keeping a queryable database, which suits servers behind NAT that a central Prometheus cannot reach.

How long should I keep metrics?

Keep as long as you need to answer real questions: a few weeks covers incident analysis, while capacity planning needs months. Past a few months, a long-term store with downsampling is usually cheaper than a bigger local disk.

Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.