---
title: "PostgreSQL with Database Observability | Grafana Labs"
description: "Set up Database Observability for PostgreSQL"
---

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

## PostgreSQL with Database Observability

Database Observability gives you deep visibility into PostgreSQL query performance, whether your database is self-managed or running on a managed cloud service.

|                        |                                                                                           |
|------------------------|-------------------------------------------------------------------------------------------|
| **What it monitors**   | Query performance, wait events, connections, replication lag, table bloat                 |
| **How it works**       | Grafana Alloy reads from `pg_stat_statements` and `pg_stat_activity`                      |
| **What you see**       | Top queries by duration, explain plans with cost highlighting, wait events, query samples |
| **Supported variants** | Self-managed PostgreSQL 14+, Amazon RDS, Amazon Aurora, Google Cloud SQL, Azure Database  |

## What you’ll get

- **Queries Overview dashboard** showing RED metrics for every query
- **Explain plans** with visual graphs showing scan types, join strategies, and cost distribution
- **Wait events** categorized by I/O, lock, and network waits from `pg_stat_activity`
- **Query samples** with individual execution timing and parameters
- **Table schemas** showing structures, indexes, and constraints

## Trade-offs

| Strengths                                                | Considerations                                                             |
|----------------------------------------------------------|----------------------------------------------------------------------------|
| Deepest PostgreSQL visibility available in Grafana Cloud | Requires PostgreSQL 14+                                                    |
| Visual explain plans with cost-coded operation nodes     | `pg_stat_statements` extension must be installed (requires restart)        |
| Wait events from `pg_stat_activity`                      | Requires a monitoring user with `pg_monitor` and `pg_read_all_stats` roles |
| Managed database support (RDS, Aurora, CloudSQL, Azure)  | First-time setup takes 30-60 minutes                                       |
| AI-powered optimization suggestions                      | Uses Grafana Alloy as collection agent                                     |

* * *

Learning path

#### PostgreSQL Database Observability

Set up Grafana Cloud Database Observability for PostgreSQL to monitor query performance, explain plans, wait events, and query samples.

13 min

Intermediate

Docs &amp; blog posts

#### Open in Grafana Cloud

Complete this learning path directly in your Grafana Cloud stack, or in the Grafana Play stack, with an interactive learning experience.

[Open in Grafana Cloud]() [Try in Grafana Play]()

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

[Path completed](/docs/learning-hub/intro-to-db-olly/02-database-observability/10-db-olly-complete/)
