Get unlimited infrastructure observability context via MCP

Ground your agent engineering
in structured observability context

Get the latest observability docs and guidance for your infrastructure via MCP

PostgreSQL
PostgreSQL
Versions: [18.1]286 metrics9 documents

PostgreSQL is a powerful, open source object-relational database system with over 35 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance. Official PostgreSQL docs: PostgreSQL 18.1 Documentation

Native PostgreSQLNative PostgreSQLOfficial PostgreSQL metrics docs:PostgreSQL 18 Documentation - The Cumulative Statistics System
DatadogDatadogOfficial Datadog PostgreSQL metrics docs:GitHubDatadog PostgreSQL Integration
OpentelemetryOpentelemetryOfficial Opentelemetry PostgreSQL metrics docs:GitHubOpenTelemetry PostgreSQL Receiver Documentation
PrometheusPrometheusOfficial Prometheus PostgreSQL metrics docs:GitHubPrometheus PostgreSQL Exporter

Get context for PostgreSQL metrics

PostgreSQLactive_timeDatadogPrometheusNCountUnits:millisecondTime spent executing SQL statements (ms)Documentation
PostgreSQLanalyzePrometheusDatadogNGaugeNumber of automatic analyzesDocumentation
PostgreSQLapply_errorNDatadogGaugeNumber of errors that occurred while applying changes. Extracted from pg_stat_subscription_stats. Only available on PostgreSQL 15 or higher. This metric is tagged with subscription_name.Documentation
PostgreSQLarchivedDatadogNCountarchived_count statistic from pg_stat_archiverDocumentation
PostgreSQLbackend_xidDatadogNGaugeUnits:transactionbackend_xid statistic from pg_stat_activityDocumentation
PostgreSQLbackend_xminDatadogNGaugebackend_xmin statistic from pg_stat_replicationDocumentation
PostgreSQLbackup_streamedNGaugebackup_streamed statistic from pg_stat_progress_basebackupDocumentation
PostgreSQLbitsNGaugebits statistic from pg_stat_sslDocumentation
PostgreSQLblk_read_timeDatadogPrometheusNCountUnits:millisecondread_time statistic from pg_stat_ioDocumentation
PostgreSQLblk_write_timeDatadogPrometheusNCountUnits:nanosecondTime spent writing WAL to disk (ms)Documentation
PostgreSQLblock_distanceDatadogNGaugeUnits:blockblock_distance statistic from pg_stat_recovery_prefetchDocumentation
PostgreSQLblock_doneNGaugeblocks_done statistic from pg_stat_progress_create_indexDocumentation
PostgreSQLblock_existsDatadogNCountUnits:blockblks_exists statistic from pg_stat_slruDocumentation
PostgreSQLblock_hitDatadogNCountUnits:blockNumber of buffer hits (blocks found in cache)Documentation
PostgreSQLblock_writeDatadogNCountUnits:blockblks_written statistic from pg_stat_slruDocumentation
PostgreSQLblock_zeroedDatadogNCountUnits:blockblks_zeroed statistic from pg_stat_slruDocumentation
PostgreSQLbuffer_backendPrometheusDatadogNGaugeNumber of buffers written directly by backendsDocumentation
PostgreSQLbuffer_backend_fsyncPrometheusDatadogNGaugeNumber of fsync calls by backendsDocumentation
PostgreSQLbuffer_checkpointPrometheusDatadogNGaugeNumber of buffers written during checkpointsDocumentation
PostgreSQLbuffer_cleanPrometheusDatadogNGaugeNumber of buffers written by background writerDocumentation
PostgreSQLbuffercache_summary_buffer_dirtyDatadogPrometheusGaugeUnits:bufferNumber of dirty shared buffersDocumentation
PostgreSQLbuffercache_summary_buffer_pinnedPrometheusGaugeNumber of pinned shared buffersDocumentation
PostgreSQLbuffercache_summary_buffer_unusedDatadogPrometheusGaugeUnits:bufferNumber of unused shared buffersDocumentation
PostgreSQLbuffercache_summary_buffer_usedDatadogPrometheusGaugeUnits:bufferNumber of used shared buffersDocumentation
PostgreSQLbuffercache_summary_usagecount_avgPrometheusGaugeAverage usage count of used shared buffersDocumentation
Full metrics context for PostgreSQL is available with an account. Request access

Understanding PostgreSQL observability

PostgreSQL's observability model is notably comprehensive due to its extensive statistics collector system that tracks detailed runtime information across multiple dimensions. Unlike many commercial databases that require proprietary agents or expensive enterprise editions for deep visibility, PostgreSQL exposes rich telemetry through system catalogs and statistics views like pg_stat_activity, pg_stat_database, and pg_stat_bgwriter. The database provides over 286 distinct metrics covering everything from buffer pool activity to background writer performance, making it particularly well-suited for integration with modern observability platforms. Common collection patterns leverage the postgres_exporter for Prometheus, OpenTelemetry's PostgreSQL receiver, or native integrations like Datadog's PostgreSQL check to transform these statistics into actionable monitoring data.

Key Use Cases

Prevent and Recover from Transaction ID Wraparound Emergencies
Access comprehensive guides on managing transaction ID exhaustion, including early warning signs, emergency recovery procedures, and configuration adjustments to prevent wraparound-related outages before they impact production.
Optimize Autovacuum Performance for Your Workload
Learn workload-aware tuning strategies that balance vacuum overhead with table bloat prevention, including how to set appropriate thresholds, scale factors, and cost delays based on your specific database usage patterns.
Diagnose and Resolve Critical Performance Degradations
Follow proven troubleshooting frameworks for identifying whether slow queries, table bloat, or misconfigured vacuum settings are the root cause, with specific metrics to monitor and corrective actions for each scenario.
Right-Size Vacuum Resources and Capacity Planning
Determine appropriate maintenance windows, worker processes, and cost budgets for vacuum operations based on database size, transaction rate, and growth projections to avoid both under-vacuuming and resource contention.
Configure Intelligent Alerting for Vacuum Health
Implement alert thresholds for age metrics like `autovacuum_freeze_max_age` and table-specific vacuum lag that catch problems early without generating false positives during normal operations.
Master Essential Vacuum Command Usage
Understand when to use VACUUM, VACUUM FULL, VACUUM FREEZE, and ANALYZE commands manually versus relying on autovacuum, including the operational impact and recovery scenarios for each approach.