Dev tools

Prometheus vs Grafana: How They Work Together

Prometheus vs Grafana: Prometheus collects and stores metrics and fires alerts, Grafana turns them into dashboards. How they differ and work as a pair.

By OmniAI Editorial · Nov 22, 2026 · 12 min read

Prometheus vs Grafana isn't really a contest: Prometheus collects and stores metrics and decides when to alert, and Grafana visualises data from Prometheus and many other sources. Prometheus is a monitoring system with a built-in time series database. Grafana is a dashboard and visualisation tool that stores almost no data of its own. Most teams run them together. Prometheus is the data source, and Grafana is the screen people look at.

The confusion is understandable, because they overlap at the edges. Prometheus has a basic graph view, Grafana has its own alerting, and Grafana Labs now sells a whole stack that can replace parts of Prometheus. This guide explains what each does, the Prometheus and Grafana difference in a table, how they work together with a minimal configuration, what each costs, and when to use alternatives.

Prometheus vs Grafana at a Glance

PrometheusGrafana
What it isMetrics collection, storage, query and alerting systemVisualisation, dashboard and alerting front end
Stores data?Yes, in its own time series databaseNo (it queries other systems)
Collects data?Yes, it pulls (scrapes) metrics from targetsNo; it reads from data sources
Data typesMetrics onlyMetrics, logs, traces, profiles and SQL data, via data sources
Query languagePromQLUses each source's language (PromQL, LogQL, SQL and others)
AlertingAlert rules plus a separate AlertmanagerGrafana Alerting, across any data source
DashboardsBasic expression browser and graphsRich, shareable dashboards and panels
LicenceApache 2.0AGPLv3 (open source); paid Enterprise and Cloud editions
GovernanceCloud Native Computing Foundation (graduated project)Grafana Labs
Default port90903000

The one-line summary: Prometheus is the engine and the database; Grafana is the dashboard.

What Is Prometheus?

Prometheus is an open-source monitoring and alerting system that collects numeric measurements (metrics) over time, stores them and lets you query them. It started at SoundCloud in 2012 and joined the Cloud Native Computing Foundation, where it became the second graduated project after Kubernetes.

Its main parts:

  • Scraping. Prometheus pulls metrics over HTTP from a /metrics endpoint on each target at a fixed interval. Applications expose metrics with client libraries, and exporters do it for systems you don't control, such as node_exporter for Linux hosts or exporters for databases. The global scrape interval defaults to one minute, and many teams set 15 or 30 seconds.
  • Time series database. Each metric plus its set of labels (for example http_requests_total{method="GET", status="500"}) is a time series stored on local disk. Retention defaults to 15 days unless you set --storage.tsdb.retention.time or a size limit.
  • PromQL. A query language for selecting and aggregating series, computing rates and percentiles, and joining metrics.
  • Alerting rules. Prometheus evaluates rules on a schedule and sends firing alerts to Alertmanager, a separate component that groups, silences and routes them to email, Slack, PagerDuty and other receivers.
  • Service discovery. Prometheus can find targets automatically in Kubernetes, cloud providers and other systems, which suits environments where containers come and go.

Prometheus 3 brought a new web UI and UTF-8 metric names, and current versions include an OTLP receiver. With the --web.enable-otlp-receiver flag, Prometheus can accept OpenTelemetry metrics that are pushed to it instead of scraped.

One design choice matters a lot. Prometheus's local storage is not clustered or replicated. The documentation describes it as limited to a single node's scalability and durability. For long-term storage, high availability or a global view across many clusters, teams add a system such as Thanos, Grafana Mimir, Cortex or VictoriaMetrics through remote write. Our explainer on the time series database covers how this kind of storage works.

What Is Grafana?

Grafana is an open-source tool for building dashboards and alerts on top of data stored elsewhere. You connect data sources, write queries in each source's language and arrange the results as panels: time series graphs, gauges, tables, heatmaps, logs and traces.

Grafana's core data sources include Prometheus, Graphite, InfluxDB and the major cloud monitoring services for metrics. They also include Loki and Elasticsearch for logs, Tempo, Jaeger and Zipkin for traces, Pyroscope for profiles, and MySQL, PostgreSQL and SQL Server for SQL data. Plugins add many more. That breadth is Grafana's main strength. One dashboard can show Prometheus metrics, matching log lines and a trace for the same request.

Other features:

  • Variables and templating: one dashboard can switch between environments, clusters or services from a drop-down.
  • Grafana Alerting: alert rules on any data source, with contact points and notification policies.
  • Sharing and access control: folders, teams, permissions and public or embedded dashboards.
  • Provisioning: data sources and dashboards defined as files, so they can live in Git.

Grafana Labs also builds a broader open-source stack often called LGTM: Loki for logs, Grafana for visualisation, Tempo for traces and Mimir for scalable Prometheus-compatible metrics. It also makes Alloy, a telemetry collector that can scrape Prometheus metrics and handle OpenTelemetry data. Alloy replaced the older Grafana Agent, which reached end of life on November 1, 2025.

The Prometheus and Grafana Difference

A grey cylinder database with ink arrows pointing out to three small grey servers on the left, an ink line to a light dashboard window with grey panels on the right, and a small grey bell with an orange clapper below the cylinder.
Prometheus pulls metrics from targets and stores them; Grafana queries Prometheus to draw dashboards.

The most important Prometheus and Grafana difference is where the data lives. Prometheus owns the data: it collects, stores and evaluates it. Grafana borrows data: every panel is a live query to a source such as Prometheus.

That leads to a split of responsibilities:

JobUsually done byWhy
Discover and scrape targetsPrometheus (or Alloy, OpenTelemetry Collector)Built for pull-based collection
Store recent metricsPrometheusIts local database is fast for recent data
Store long-term or global metricsMimir, Thanos, VictoriaMetrics, cloud servicesPrometheus local storage is single-node
Compute aggregationsPromQL in PrometheusRecording rules pre-compute heavy queries
Alert on metricsPrometheus rules and Alertmanager, or Grafana AlertingBoth work; pick one main path
Show dashboardsGrafanaPrometheus's own UI is for ad hoc queries
Combine metrics, logs and tracesGrafanaMany data sources in one view

How Prometheus and Grafana Work Together

Here is how Prometheus and Grafana work together in a typical setup:

  1. Your applications and exporters expose metrics on HTTP endpoints.
  2. Prometheus scrapes those endpoints every 15 to 60 seconds and stores the samples.
  3. Prometheus evaluates recording rules (saved queries) and alert rules. Firing alerts go to Alertmanager, which notifies people.
  4. Grafana has Prometheus configured as a data source. When someone opens a dashboard, each panel sends a PromQL query to Prometheus and draws the result.

A minimal Prometheus configuration that scrapes itself and a Linux host:

global:
  scrape_interval: 15s
  evaluation_interval: 15s

scrape_configs:
  - job_name: "prometheus"
    static_configs:
      - targets: ["localhost:9090"]

  - job_name: "node"
    static_configs:
      - targets: ["node-exporter:9100"]

A Grafana data source file, placed in Grafana's provisioning/datasources folder, connects Grafana to it:

apiVersion: 1

datasources:
  - name: Prometheus
    type: prometheus
    access: proxy
    url: http://prometheus:9090
    isDefault: true

Two PromQL queries you might put on a dashboard. The first is the per-second rate of HTTP requests over five minutes, grouped by status code. The second is the 95th percentile request duration from a histogram.

sum by (status) (rate(http_requests_total[5m]))

histogram_quantile(0.95, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))

In Kubernetes, most teams install the pair together through the community kube-prometheus-stack Helm chart. It deploys Prometheus, Alertmanager, Grafana, exporters and a set of ready-made dashboards and alerts. For how containers and orchestration fit in, see Docker vs Kubernetes.

What Is Prometheus and Grafana Used For?

What is Prometheus and Grafana used for in practice? The pair covers most metric-based monitoring:

  • Infrastructure monitoring: CPU, memory, disk and network for servers, virtual machines and containers.
  • Kubernetes monitoring: pod restarts, resource requests vs usage, node pressure and cluster capacity.
  • Application metrics: request rates, error rates and latency per endpoint (the RED method), queue depths and job durations.
  • Service level objectives: tracking availability and latency against targets, and alerting on how fast the error budget is being used up. Our guide to site reliability engineering explains the practice.
  • Business dashboards: sign-ups, orders and payments, as long as they can be counted as metrics.
  • Home labs and IoT: temperature sensors, home servers and network gear through exporters.

What they don't cover on their own: Prometheus doesn't store logs or traces, and Grafana doesn't store anything. For logs and traces you add Loki and Tempo, or another back end, and view them in Grafana.

Alerting: Prometheus or Grafana?

Two light panels side by side: on the left a grey cylinder with an ink arrow to a grey bell, on the right a grey chart window with an ink arrow to a grey bell with an orange clapper.
Alerts can come from Prometheus rules through Alertmanager or from Grafana Alerting; pick one main path.

Both can alert, which raises a real choice.

Prometheus rules with Alertmanager keep alerting next to the data. Rules live in files in version control, run inside Prometheus and keep working even if Grafana is down. Alertmanager is strong at grouping and deduplicating alerts and silencing them during maintenance.

Grafana Alerting can alert on any data source, including logs, SQL and cloud metrics, and has a UI that is friendlier for teams who don't want to edit YAML. It depends on Grafana being up and able to reach its data sources.

A common pattern is to put critical infrastructure and SLO alerts in Prometheus and Alertmanager, and to use Grafana Alerting for data that doesn't live in Prometheus. Whichever you choose, avoid defining the same alert in both, or people will be paged twice.

Is Prometheus and Grafana Free?

Yes, both are free and open source to run yourself. Prometheus uses the Apache 2.0 licence and Grafana uses AGPLv3. AGPL lets you use and modify Grafana freely, including at work; its extra obligations apply mainly if you modify Grafana and offer it to others over a network.

The real costs are elsewhere:

  • Compute and storage for Prometheus, which grow with the number of active time series. High-cardinality labels such as user IDs can multiply this quickly.
  • Long-term storage if you keep months or years of data.
  • People time to run upgrades, scale storage and keep dashboards and alerts useful.

Paid options exist if you'd rather not run it yourself. Grafana Labs offers Grafana Cloud (with a free tier) and Grafana Enterprise. The major cloud providers offer managed Prometheus and managed Grafana services. Check current pricing pages, since limits and prices change.

ToolWhat it replaces or addsNotes
Grafana Mimir, Thanos, CortexLong-term, scalable Prometheus storageKeep PromQL; add durability and global queries
VictoriaMetricsPrometheus-compatible storage and scrapingKnown for efficient storage
KibanaGrafana, for Elasticsearch dataStrongest for logs and search in the Elastic stack
OpenTelemetry Collector, Grafana AlloyCollection layerCollect metrics, logs and traces and send them to any back end
Datadog, New Relic, DynatraceBoth, as a hosted platformLess to run, usage-based pricing
Zabbix, NagiosTraditional host and network monitoringAgent and check based, less cloud native

If you are comparing Grafana vs Kibana, the short version is that Kibana is tied to Elasticsearch and excels at log search. Grafana is source-neutral and excels at metrics dashboards that combine many sources.

Prometheus vs Grafana: Which Should You Use?

  • You need metrics collection and alerting: start with Prometheus (or a Prometheus-compatible collector).
  • You need dashboards people will actually look at: add Grafana. Prometheus's built-in UI is for exploring queries, not for team dashboards.
  • You have data in many systems: Grafana is the common layer, whether or not Prometheus is one of the sources.
  • You run many clusters or need a year of data: keep Prometheus or Alloy for collection, and add Mimir, Thanos or VictoriaMetrics for storage.
  • You don't want to run any of it: use a managed Prometheus and Grafana service, or a hosted observability platform.

For most teams the answer to Prometheus vs Grafana is "both": Prometheus to collect and alert, Grafana to see.

Common Mistakes

  • Expecting Prometheus to keep data forever. The default retention is 15 days. Plan retention and long-term storage up front.
  • High-cardinality labels. Putting user IDs, request IDs or full URLs in labels creates millions of series and can exhaust memory.
  • Dashboards built on raw heavy queries. Large dashboards that run expensive PromQL on every refresh slow Prometheus down. Use recording rules for queries you run often.
  • Alerting on everything. Page on symptoms users feel (errors, latency, saturation), and send the rest to tickets or dashboards.
  • Running one Prometheus with no backup. A single node is a single point of failure for your alerts. Run two identical Prometheus servers for important alerting, or use a managed service.

FAQ

Can Grafana work without Prometheus?

Yes. Grafana works with dozens of data sources, including cloud monitoring services, SQL databases, Elasticsearch, InfluxDB and Loki. Prometheus is just the most common pairing.

Can Prometheus work without Grafana?

Yes. Prometheus has its own web UI for running queries and graphing results, and it alerts through Alertmanager without Grafana. Most teams still add Grafana for better dashboards.

Is Prometheus a database?

Partly. Prometheus includes a time series database, but it is a complete monitoring system that also collects metrics, evaluates rules and sends alerts. Its local storage is designed for recent data on one node.

What ports do Prometheus and Grafana use?

By default Prometheus listens on port 9090, Grafana on port 3000, Alertmanager on 9093 and node_exporter on 9100. All can be changed in configuration.

Does Prometheus support OpenTelemetry?

Yes. Recent versions can receive OpenTelemetry metrics over OTLP when started with the --web.enable-otlp-receiver flag, in addition to scraping. Collectors such as the OpenTelemetry Collector and Grafana Alloy can also send OpenTelemetry metrics to Prometheus.

All articles

Read next

Language

EnglishEnglish · en TürkçeTurkish · tr DeutschGerman · de العربيةArabic · ar

Account

Enter your email. We’ll send you a sign-in link and a 6-digit code. No password needed.

Sign in

Theme

Language

Show our email address

To keep spam out of our inbox, please confirm your own email first. We will send you a 6-digit code.

We send codes only to these providers: gmail.com, googlemail.com, outlook.com, hotmail.com, live.com, msn.com, proton.me, protonmail.com, pm.me, icloud.com, me.com, mac.com, yahoo.com, aol.com, gmx.de, gmx.net, web.de, t-online.de, yandex.com, omniai.blog