---
title: "PostgreSQL integration | Grafana Labs"
description: "Set up PostgreSQL monitoring with Grafana Cloud integrations as a fallback to Database Observability"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

## PostgreSQL integration

If you need infrastructure-level PostgreSQL monitoring without the deeper query analysis that Database Observability provides, the PostgreSQL integration gives you connections, replication, cache performance, and table-level metrics out of the box.

**Already using Database Observability for PostgreSQL?** You don’t need this integration. Database Observability includes everything the integration provides and adds query-level analysis on top. This integration is for users who want PostgreSQL monitoring without the deeper query-level features.

|                        |                                                                                                                                    |
|------------------------|------------------------------------------------------------------------------------------------------------------------------------|
| **What it monitors**   | Connections, replication lag, cache hit ratios, locks, table bloat, background writer, and query stats (with pg\_stat\_statements) |
| **How it works**       | Grafana Alloy’s built-in PostgreSQL exporter scrapes metrics from your PostgreSQL instance                                         |
| **What you get**       | 19 alerts + 4 dashboards + log collection                                                                                          |
| **Supported versions** | Broad PostgreSQL version support                                                                                                   |

## What you’ll see in the dashboards

- **PostgreSQL cluster overview** — Cluster-wide connection usage, transaction throughput, cache hit ratio, and replication status
- **PostgreSQL instance overview** — Per-instance sizes, throughput, and cache statistics
- **PostgreSQL query performance** — Top queries by calls, total time, and mean time (requires pg\_stat\_statements extension)
- **PostgreSQL logs** — Log analysis for error tracking and troubleshooting

## Integration vs. Database Observability

| PostgreSQL integration                            | Database Observability                   |
|---------------------------------------------------|------------------------------------------|
| Aggregate query statistics (pg\_stat\_statements) | Individual query samples with timing     |
| Connection and lock counts                        | Which connections consume resources      |
| Replication status                                | Replication lag with detail              |
| Table bloat and vacuum tracking                   | Explain plans and wait events            |
| Broad PostgreSQL version support                  | PostgreSQL 14+ with pg\_stat\_statements |
| 15–20 minute setup                                | 30–60 minute setup                       |

## Trade-offs

| Strengths                                        | Considerations                                                       |
|--------------------------------------------------|----------------------------------------------------------------------|
| Richest integration — 19 alerts and 4 dashboards | No explain plans or wait events                                      |
| Table-level vacuum and bloat tracking            | Aggregate query stats, not individual query samples                  |
| Log collection for error tracking                | For deep query analysis, Database Observability is the better choice |
| Broad PostgreSQL version support                 | Query performance dashboard requires pg\_stat\_statements extension  |

* * *

Learning path

#### Monitor PostgreSQL with Grafana Alloy

Welcome to the Grafana learning path that shows you how to monitor PostgreSQL databases with Grafana Alloy and use pre-built dashboards and alerts in Grafana Cloud.

18 min

Beginner

Docs &amp; blog posts

#### Open in Grafana Cloud

Complete this learning path directly in your Grafana Cloud stack with an interactive learning experience.

[Open in Grafana Cloud]()

[View on website](/docs/learning-paths/postgresql-integration/)

[Path completed](/docs/learning-hub/intro-to-db-olly/03-database-integrations/19-integration-complete/)
