---
title: "PostgreSQL integration | Grafana Labs"
description: "Monitoring PostgreSQL databases"
---

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

# PostgreSQL integration

The PostgreSQL integration monitors connections, replication, cache, locks, and table metrics. The integration reference calls this infrastructure-level observability. For query-level detail (slow queries, wait events, and execution plans), use [Database Observability](/docs/grafana-cloud/monitor-applications/database-observability/).

|                    |                                                                              |
|--------------------|------------------------------------------------------------------------------|
| **What it’s for**  | Monitoring queries, connections, replication, and vacuum/bloat health        |
| **Under the hood** | Uses the PostgreSQL exporter (`prometheus.exporter.postgres`) and scrapes it |

## Metrics collected

The integration collects these PostgreSQL metric groups:

- **Queries**: Active, waiting, and duration. Waiting queries usually point to lock contention.
- **Connections**: Used, available, and by state, including how close you are to `max_connections`.
- **Transactions**: Commits, rollbacks, conflicts
- **Replication**: Lag and slot status, which show whether a standby is ready for failover.
- **Vacuum**: Dead tuples and autovacuum. PostgreSQL keeps old row versions until vacuum removes them, and the dashboards track that buildup.

## What to know

This integration offers:

- Prebuilt dashboards: PostgreSQL cluster overview, PostgreSQL instance overview, PostgreSQL logs, PostgreSQL query performance
- Prebuilt alerts: connections, replication, vacuum
- Buffer cache hit ratio
- Query waiting and lock detection

* * *

## Set it up

Open this path in your Grafana Cloud stack for a fully interactive experience, or read through it to understand the process first.

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/)
