Slide 8 of 10

PostgreSQL integration

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 monitorsConnections, replication lag, cache hit ratios, locks, table bloat, background writer, and query stats (with pg_stat_statements)
How it worksGrafana Alloy’s built-in PostgreSQL exporter scrapes metrics from your PostgreSQL instance
What you get19 alerts + 4 dashboards + log collection
Supported versionsBroad 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 integrationDatabase Observability
Aggregate query statistics (pg_stat_statements)Individual query samples with timing
Connection and lock countsWhich connections consume resources
Replication statusReplication lag with detail
Table bloat and vacuum trackingExplain plans and wait events
Broad PostgreSQL version supportPostgreSQL 14+ with pg_stat_statements
15–20 minute setup30–60 minute setup

Trade-offs

StrengthsConsiderations
Richest integration — 19 alerts and 4 dashboardsNo explain plans or wait events
Table-level vacuum and bloat trackingAggregate query stats, not individual query samples
Log collection for error trackingFor deep query analysis, Database Observability is the better choice
Broad PostgreSQL version supportQuery 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 & blog posts

Open in Grafana Cloud

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

Path completed

Script

The PostgreSQL integration is the richest integration in this module, with 19 alerts and 4 dashboards. It covers connections, replication lag, cache performance, table-level metrics, and even aggregate query statistics when the pg_stat_statements extension is enabled.

Like MySQL, if Database Observability is already set up for PostgreSQL, this integration isn’t needed. Database Observability provides everything the integration does plus individual query samples, explain plans, and wait events.

The four dashboards span different levels of detail. The cluster overview tracks cluster-wide connection usage, transaction throughput, and replication status. The instance overview drills into per-instance performance. Query performance reports top queries by calls and total time. And the logs dashboard helps with error tracking and troubleshooting.

The comparison table highlights the tradeoff. The integration gives broad coverage across PostgreSQL versions. Database Observability gives deeper analysis for individual queries.

If PostgreSQL integration is the right fit, scroll down to start the learning path.