The only agent that thinks for itself

Autonomous Monitoring with self-learning AI built-in, operating independently across your entire stack.

Unlimited Metrics & Logs
Machine learning & MCP
5% CPU, 150MB RAM
3GB disk, >1 year retention
800+ integrations, zero config
Dashboards, alerts out of the box
> Discover Netdata Agents

Centralized metrics streaming and storage

Aggregate metrics from multiple agents into centralized Parent nodes for unified monitoring across your infrastructure.

Stream from unlimited agents
Long-term data retention
High availability clustering
Data replication & backup
Scalable architecture
Enterprise-grade security
> Learn about Parents

Fully managed cloud platform

Access your monitoring data from anywhere with our SaaS platform. No infrastructure to manage, automatic updates, and global availability.

Zero infrastructure management
99.9% uptime SLA
Global data centers
Automatic updates & patches
Enterprise SSO & RBAC
SOC2 & ISO certified
> Explore Netdata Cloud

Deploy Netdata Cloud in your infrastructure

Run the full Netdata Cloud platform on-premises for complete data sovereignty and compliance with your security policies.

Complete data sovereignty
Air-gapped deployment
Custom compliance controls
Private network integration
Dedicated support team
Kubernetes & Docker support
> Learn about Cloud On-Premises

Powerful, intuitive monitoring interface

Modern, responsive UI built for real-time troubleshooting with customizable dashboards and advanced visualization capabilities.

Real-time chart updates
Customizable dashboards
Dark & light themes
Advanced filtering & search
Responsive on all devices
Collaboration features
> Explore Netdata UI

Monitor on the go

Native iOS and Android apps bring full monitoring capabilities to your mobile device with real-time alerts and notifications.

iOS & Android apps
Push notifications
Touch-optimized interface
Offline data access
Biometric authentication
Widget support
> Download apps

The future of infrastructure observability

See our strategic direction across AI-native observability, full-stack signals, operational intelligence, and enterprise platform maturity.

AI-native observability
Full-stack signal coverage
Operational intelligence
Enterprise platform maturity
Agent releases every 6 weeks
Cloud continuous delivery
> Explore Product Roadmap

Best energy efficiency

True real-time per-second

100% automated zero config

Centralized observability

Multi-year retention

High availability built-in

Zero maintenance

Always up-to-date

Enterprise security

Complete data control

Air-gap ready

Compliance certified

Millisecond responsiveness

Infinite zoom & pan

Works on any device

Native performance

Instant alerts

Monitor anywhere

AI-native observability

Continuous delivery

Open source foundation

80% Faster Incident Resolution

AI-powered troubleshooting from detection, to root cause and blast radius identification, to reporting.

True Real-Time and Simple, even at Scale

Linearly and infinitely scalable full-stack observability, that can be deployed even mid-crisis.

90% Cost Reduction, Full Fidelity

Instead of centralizing the data, Netdata distributes the code, eliminating pipelines and complexity.

See and Map Your Entire Network

Live topology, flow analytics, and SNMP device and trap monitoring — unified with your full-stack observability.

Control Without Surrender

SOC 2 Type 2 certified with every metric kept on your infrastructure.

Integrations

800+ collectors and notification channels, auto-discovered and ready out of the box.

800+ data collectors
Auto-discovery & zero config
Cloud, infra, app protocols
Notifications out of the box
> Explore integrations
Real Results
46% Cost Reduction

Reduced monitoring costs by 46% while cutting staff overhead by 67%.

— Leonardo Antunez, Codyas

Zero Pipeline

No data shipping. No central storage costs. Query at the edge.

From Our Users
"Out-of-the-Box"

So many out-of-the-box features! I mostly don't have to develop anything.

— Simon Beginn, LANCOM Systems

No Query Language

Point-and-click troubleshooting. No PromQL, no LogQL, no learning curve.

Enterprise Ready
67% Less Staff, 46% Cost Cut

Enterprise efficiency without enterprise complexity—real ROI from day one.

— Leonardo Antunez, Codyas

SOC 2 Type 2 Certified

Zero data egress. Only metadata reaches the cloud. Your metrics stay on your infrastructure.

Full Coverage
800+ Collectors

Auto-discovered and configured. No manual setup required.

Any Notification Channel

Slack, PagerDuty, Teams, email, webhooks—all built-in.

Built for the People Who Get Paged

Because 3am alerts deserve instant answers, not hour-long hunts.

Every Industry Has Rules. We Master Them.

See how healthcare, finance, and government teams cut monitoring costs 90% while staying audit-ready.

Monitor Any Technology. Configure Nothing.

Install the agent. It already knows your stack.
From Our Users
"A Rare Unicorn"

Netdata gives more than you invest in it. A rare unicorn that obeys the Pareto rule.

— Eduard Porquet Mateu, TMB Barcelona

99% Downtime Reduction

Reduced website downtime by 99% and cloud bill by 30% using Netdata alerts.

— Falkland Islands Government

Real Savings
30% Cloud Cost Reduction

Optimized resource allocation based on Netdata alerts cut cloud spending by 30%.

— Falkland Islands Government

46% Cost Cut

Reduced monitoring staff by 67% while cutting operational costs by 46%.

— Codyas

Real Coverage
"Plugin for Everything"

Netdata has agent capacity or a plugin for everything, including Windows and Kubernetes.

— Eduard Porquet Mateu, TMB Barcelona

"Out-of-the-Box"

So many out-of-the-box features! I mostly don't have to develop anything.

— Simon Beginn, LANCOM Systems

Real Speed
Troubleshooting in 30 Seconds

From 2-3 minutes to 30 seconds—instant visibility into any node issue.

— Matthew Artist, Nodecraft

20% Downtime Reduction

20% less downtime and 40% budget optimization from out-of-the-box monitoring.

— Simon Beginn, LANCOM Systems

Pay per Node. Unlimited Everything Else.

One price per node. Unlimited metrics, logs, users, and retention. No per-GB surprises.

Free tier—forever
No metric limits or caps
Retention you control
Cancel anytime
> See pricing plans

What's Your Monitoring Really Costing You?

Most teams overpay by 40-60%. Let's find out why.

Expose hidden metric charges
Calculate tool consolidation
Customers report 30-67% savings
Results in under 60 seconds
> See what you're really paying

Your Infrastructure Is Unique. Let's Talk.

Because monitoring 10 nodes is different from monitoring 10,000.

On-prem & air-gapped deployment
Volume pricing & agreements
Architecture review for your scale
Compliance & security support
> Start a conversation

Monitoring That Sells Itself

Deploy in minutes. Impress clients in hours. Earn recurring revenue for years.

30-second live demos close deals
Zero config = zero support burden
Competitive margins & deal protection
Response in 48 hours
> Apply to partner

Per-Second Metrics at Homelab Prices

Same engine, same dashboards, same ML. Just priced for tinkerers.

Community: Free forever · 5 nodes · non-commercial
Homelab: $90/yr · unlimited nodes · fair usage
> Get the Homelab Plan

$1,000 Per Referral. Unlimited Referrals.

Your colleagues get 10% off. You get 10% commission. Everyone wins.

10% of subscriptions, up to $1,000 each
Track earnings inside Netdata Cloud
PayPal/Venmo payouts in 3-4 weeks
No caps, no complexity
> Get your referral link
Cost Proof
40% Budget Optimization

"Netdata's significant positive impact" — LANCOM Systems

Calculate Your Savings

Compare vs Datadog, Grafana, Dynatrace

Savings Proof
46% Cost Reduction

"Cut costs by 46%, staff by 67%" — Codyas

30% Cloud Bill Savings

"Reduced cloud bill by 30%" — Falkland Islands Gov

Enterprise Proof
"Better Than Combined Alternatives"

"Better observability with Netdata than combining other tools." — TMB Barcelona

Real Engineers, <24h Response

DPA, SLAs, on-prem, volume pricing

Why Partners Win
Demo Live Infrastructure

One command, 30 seconds, real data—no sandbox needed

Zero Tickets, High Margins

Auto-config + per-node pricing = predictable profit

Homelab Ready
Free Video Course

8-episode Netdata tutorial by LearnLinux.tv

76k+ GitHub Stars

3rd most starred monitoring project

Worth Recommending
Product That Delivers

Customers report 40-67% cost cuts, 99% downtime reduction

Zero Risk to Your Rep

Free tier lets them try before they buy

AI Support Assistant, Available 24/7

Nedi has access to all official documentation, source code, and resources. Ask any question about Netdata—responds in your language.

Deployment & configuration
Troubleshooting & sizing
Alerts & notifications
Evidence-based answers
> Ask Nedi now

Never Fight Fires Alone

Docs, community, and expert help—pick your path to resolution.

Learn.netdata.cloud docs
Discord, Forums, GitHub
Premium support available
> Get answers now

60 Seconds to First Dashboard

One command to install. Zero config. 850+ integrations documented.

Linux, Windows, K8s, Docker
Auto-discovers your stack
> Read our documentation

76,000+ Engineers Strong

615+ contributors. 1.5M daily downloads. One mission: simplify observability.

Per-Second. 90% Cheaper. Data Stays Home.

Side-by-side comparisons: costs, real-time granularity, and data sovereignty for every major tool.

See why teams switch from Datadog, Prometheus, Grafana, and more.

> Browse all comparisons
Edge-Native Observability, Born Open Source
Per-second visibility, ML on every metric, and data that never leaves your infrastructure.
Founded in 2016
615+ contributors worldwide
Remote-first, engineering-driven
Open source first
> Read our story
Promises We Publish—and Prove
12 principles backed by open code, independent validation, and measurable outcomes.
Open source, peer-reviewed
Zero config, instant value
Data sovereignty by design
Aligned pricing, no surprises
> See all 12 principles
Edge-Native, AI-Ready, 100% Open
76k+ stars. Full ML, AI, and automation—GPLv3+, not premium add-ons.
76,000+ GitHub stars
GPLv3+ licensed forever
ML on every metric, included
Zero vendor lock-in
> Explore our open source
Build Real-Time Observability for the World
Remote-first team shipping per-second monitoring with ML on every metric.
Remote-first, fully distributed
Open source (76k+ stars)
Challenging technical problems
Your code on millions of systems
> See open roles
Meet the Team Behind Netdata
Conferences, meetups, and tradeshows where you can see Netdata in action and talk to the engineers who build it.
Live demos and deep dives
Book 1-on-1 meetings
Talks and panel sessions
Event recaps and photos
> See all events
Talk to a Netdata Human in <24 Hours
Sales, partnerships, press, or professional services—real engineers, fast answers.
Discuss your observability needs
Pricing and volume discounts
Partnership opportunities
Media and press inquiries
> Book a conversation
Your Data. Your Rules.
On-prem data, cloud control plane, transparent terms.
Trust & Scale
76,000+ GitHub Stars

One of the most popular open-source monitoring projects

SOC 2 Type 2 Certified

Enterprise-grade security and compliance

Data Sovereignty

Your metrics stay on your infrastructure

Validated
University of Amsterdam

"Most energy-efficient monitoring solution" — ICSOC 2023, peer-reviewed

ADASTEC (Autonomous Driving)

"Doesn't miss alerts—mission-critical trust for safety software"

Community Stats
615+ Contributors

Global community improving monitoring for everyone

1.5M+ Downloads/Day

Trusted by teams worldwide

GPLv3+ Licensed

Free forever, fully open source agent

Why Join?
Remote-First

Work from anywhere, async-friendly culture

Impact at Scale

Your work helps millions of systems

PostgreSQL (go.d.plugin postgres) icon

PostgreSQL (go.d.plugin postgres)

PostgreSQL (go.d.plugin postgres) documentation

PostgreSQL

Plugin: go.d.plugin Module: postgres

Overview

This collector monitors the activity and performance of Postgres servers, collects replication statistics, metrics for each database, table and index, and more.

It establishes a connection to the Postgres instance via a TCP or UNIX socket. To collect metrics for database tables and indexes, it establishes an additional connection for each discovered database.

This collector is supported on all platforms.

This collector supports collecting metrics from multiple instances of this integration, including remote instances.

Default Behavior

Auto-Detection

By default, it detects instances running on localhost by trying to connect as root and netdata using known PostgreSQL TCP and UNIX sockets:

  • 127.0.0.1:5432
  • /var/run/postgresql/

Limits

Table and index metrics are not collected for databases with more than 50 tables or 250 indexes. These limits can be changed in the configuration file.

Performance Impact

The default configuration for this integration is not expected to impose a significant performance impact on the system.

Setup

You can configure the postgres collector in two ways:

MethodBest forHow to
UIFast setup without editing filesGo to Nodes → Configure this node → Collectors → Jobs, search for postgres, then click + to add a job.
FileIf you prefer configuring via file, or need to automate deployments (e.g., with Ansible)Edit go.d/postgres.conf and add a job.

Important

UI configuration requires paid Netdata Cloud plan.

Prerequisites

Create netdata user

Create a user with granted pg_monitor or pg_read_all_stat built-in role.

To create the netdata user with these permissions, execute the following in the psql session, as a user with CREATEROLE privileges:

CREATE USER netdata;
GRANT pg_monitor TO netdata;

After creating the new user, restart the Netdata Agent with sudo systemctl restart netdata, or the appropriate method for your system.

Configuration

Options

The following options can be defined globally: update_every, autodetection_retry.

GroupOptionDescriptionDefaultRequired
Collectionupdate_everyData collection interval (seconds).1no
autodetection_retryAutodetection retry interval (seconds). Set 0 to disable.0no
TargetdsnPostgres connection string (DSN). See DSN syntax.postgres://postgres:postgres@127.0.0.1:5432/postgresyes
Cloud Authcloud_auth.providerCloud auth provider (none or azure_ad).noneno
Cloud Auth/Azurecloud_auth.azure_ad.modeAzure AD credential mode (service_principal, managed_identity, or default). Required when cloud_auth.provider is azure_ad.yes
cloud_auth.azure_ad.mode_service_principal.tenant_idAzure tenant ID. Required for service_principal mode.no
cloud_auth.azure_ad.mode_service_principal.client_idAzure client ID. Required for service_principal mode.no
cloud_auth.azure_ad.mode_service_principal.client_secretAzure client secret for service_principal mode.no
cloud_auth.azure_ad.mode_managed_identity.client_idOptional client ID of a user-assigned managed identity (managed_identity mode).no
TargettimeoutQuery timeout (seconds).2no
Filterscollect_databases_matchingDatabase selector. Controls which databases are included. Uses simple patterns.no
Limitsmax_db_tablesMaximum number of tables per database to collect metrics for (0 = no limit).50no
max_db_indexesMaximum number of indexes per database to collect metrics for (0 = no limit).250no
Functionsfunctions.top_queries.disabledDisable the top-queries function.nono
functions.top_queries.timeoutQuery timeout (seconds). Uses collector timeout if not set.no
functions.top_queries.limitMaximum number of queries to return.500no
Virtual NodevnodeAssociates this data collection job with a Virtual Node.no

via UI

Configure the postgres collector from the Netdata web interface:

  1. Go to Nodes.
  2. Select the node where you want the postgres data-collection job to run and click the :gear: (Configure this node). That node will run the data collection.
  3. The Collectors → Jobs view opens by default.
  4. In the Search box, type postgres (or scroll the list) to locate the postgres collector.
  5. Click the + next to the postgres collector to add a new job.
  6. Fill in the job fields, then click Test to verify the configuration and Submit to save.
    • Test runs the job with the provided settings and shows whether data can be collected.
    • If it fails, an error message appears with details (for example, connection refused, timeout, or command execution errors), so you can adjust and retest.

via File

The configuration file name for this integration is go.d/postgres.conf.

The file format is YAML. Generally, the structure is:

update_every: 1
autodetection_retry: 0
jobs:
  - name: some_name1
  - name: some_name2

You can edit the configuration file using the edit-config script from the Netdata config directory.

cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
sudo ./edit-config go.d/postgres.conf
Examples
TCP socket

An example configuration.

jobs:
  - name: local
    dsn: 'postgresql://netdata@127.0.0.1:5432/postgres'
Unix socket

An example configuration.

jobs:
  - name: local
    dsn: 'host=/var/run/postgresql dbname=postgres user=netdata'
Unix socket (custom port)

Connect to PostgreSQL using a Unix socket with a non-default port (5433).

jobs:
  - name: local
    dsn: 'host=/var/run/postgresql port=5433 dbname=postgres user=netdata'
Azure Database for PostgreSQL with service principal

Use Microsoft Entra service principal authentication.

jobs:
  - name: azure_postgres_sp
    dsn: 'postgresql://netdata@myserver.postgres.database.azure.com:5432/postgres?sslmode=require'
    cloud_auth:
      provider: azure_ad
      azure_ad:
        mode: service_principal
        mode_service_principal:
          tenant_id: "00000000-0000-0000-0000-000000000000"
          client_id: "11111111-1111-1111-1111-111111111111"
          client_secret: "super-secret-value"
Azure Database for PostgreSQL with managed identity

Use managed identity authentication (system-assigned by default).

jobs:
  - name: azure_postgres_mi
    dsn: 'postgresql://netdata@myserver.postgres.database.azure.com:5432/postgres?sslmode=require'
    cloud_auth:
      provider: azure_ad
      azure_ad:
        mode: managed_identity
Multi-instance

Note

When you define multiple jobs, their names must be unique.

Local and remote instances.

jobs:
  - name: local
    dsn: 'postgresql://netdata@127.0.0.1:5432/postgres'

  - name: remote
    dsn: 'postgresql://netdata@203.0.113.0:5432/postgres'

Metrics

Metrics grouped by scope.

The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.

Per PostgreSQL instance

These metrics refer to the entire monitored application.

This scope has no labels.

Metrics:

MetricDescriptionDimensionsUnit
postgres.connections_utilizationConnections utilizationusedpercentage
postgres.connections_usageConnections usageavailable, usedconnections
postgres.connections_state_countConnections in each stateactive, idle, idle_in_transaction, idle_in_transaction_aborted, disabledconnections
postgres.transactions_durationObserved transactions timea dimension per buckettransactions/s
postgres.queries_durationObserved active queries timea dimension per bucketqueries/s
postgres.locks_utilizationAcquired locks utilizationusedpercentage
postgres.checkpoints_rateCheckpointsscheduled, requestedcheckpoints/s
postgres.checkpoints_timeCheckpoint timewrite, syncmilliseconds
postgres.bgwriter_halts_rateBackground writer scan haltsmaxwrittenevents/s
postgres.buffers_io_rateBuffers written ratecheckpoint, backend, bgwriterB/s
postgres.buffers_backend_fsync_rateBackend fsync callsfsynccalls/s
postgres.buffers_allocated_rateBuffers allocatedallocatedB/s
postgres.wal_io_rateWrite-Ahead Log writeswriteB/s
postgres.wal_files_countWrite-Ahead Log fileswritten, recycledfiles
postgres.wal_archiving_files_countWrite-Ahead Log archived filesready, donefiles/s
postgres.autovacuum_workers_countAutovacuum workersanalyze, vacuum_analyze, vacuum, vacuum_freeze, brin_summarizeworkers
postgres.txid_exhaustion_towards_autovacuum_percPercent towards emergency autovacuumemergency_autovacuumpercentage
postgres.txid_exhaustion_percPercent towards transaction ID wraparoundtxid_exhaustionpercentage
postgres.txid_exhaustion_oldest_txid_numOldest transaction XIDxidxid
postgres.catalog_relations_countRelation countordinary_table, index, sequence, toast_table, view, materialized_view, composite_type, foreign_table, partitioned_table, partitioned_indexrelations
postgres.catalog_relations_sizeRelation sizeordinary_table, index, sequence, toast_table, view, materialized_view, composite_type, foreign_table, partitioned_table, partitioned_indexB
postgres.uptimeUptimeuptimeseconds
postgres.databases_countNumber of databasesdatabasesdatabases

Per repl application

These metrics refer to the replication application.

Labels:

LabelDescription
applicationapplication name

Metrics:

MetricDescriptionDimensionsUnit
postgres.replication_app_wal_lag_sizeStandby application WAL lag sizesent_lag, write_lag, flush_lag, replay_lagB
postgres.replication_app_wal_lag_timeStandby application WAL lag timewrite_lag, flush_lag, replay_lagseconds

Per repl slot

These metrics refer to the replication slot.

Labels:

LabelDescription
slotreplication slot name

Metrics:

MetricDescriptionDimensionsUnit
postgres.replication_slot_files_countReplication slot fileswal_keep, pg_replslot_filesfiles

Per database

These metrics refer to the database.

Labels:

LabelDescription
databasedatabase name

Metrics:

MetricDescriptionDimensionsUnit
postgres.db_transactions_ratioDatabase transactions ratiocommitted, rollbackpercentage
postgres.db_transactions_rateDatabase transactionscommitted, rollbacktransactions/s
postgres.db_connections_utilizationDatabase connections utilizationusedpercentage
postgres.db_connections_countDatabase connectionsconnectionsconnections
postgres.db_cache_io_ratioDatabase buffer cache miss ratiomisspercentage
postgres.db_io_rateDatabase readsmemory, diskB/s
postgres.db_ops_fetched_rows_ratioDatabase rows fetched ratiofetchedpercentage
postgres.db_ops_read_rows_rateDatabase rows readreturned, fetchedrows/s
postgres.db_ops_write_rows_rateDatabase rows writteninserted, deleted, updatedrows/s
postgres.db_conflicts_rateDatabase canceled queriesconflictsqueries/s
postgres.db_conflicts_reason_rateDatabase canceled queries by reasontablespace, lock, snapshot, bufferpin, deadlockqueries/s
postgres.db_deadlocks_rateDatabase deadlocksdeadlocksdeadlocks/s
postgres.db_locks_held_countDatabase locks heldaccess_share, row_share, row_exclusive, share_update, share, share_row_exclusive, exclusive, access_exclusivelocks
postgres.db_locks_awaited_countDatabase locks awaitedaccess_share, row_share, row_exclusive, share_update, share, share_row_exclusive, exclusive, access_exclusivelocks
postgres.db_temp_files_created_rateDatabase created temporary filescreatedfiles/s
postgres.db_temp_files_io_rateDatabase temporary files data written to diskwrittenB/s
postgres.db_sizeDatabase sizesizeB

Per table

These metrics refer to the database table.

Labels:

LabelDescription
databasedatabase name
schemaschema name
tabletable name
parent_tableparent table name

Metrics:

MetricDescriptionDimensionsUnit
postgres.table_rows_dead_ratioTable dead rowsdeadpercentage
postgres.table_rows_countTable total rowslive, deadrows
postgres.table_ops_rows_rateTable throughputinserted, deleted, updatedrows/s
postgres.table_ops_rows_hot_ratioTable HOT updates ratiohotpercentage
postgres.table_ops_rows_hot_rateTable HOT updateshotrows/s
postgres.table_cache_io_ratioTable I/O cache miss ratiomisspercentage
postgres.table_io_rateTable I/Omemory, diskB/s
postgres.table_index_cache_io_ratioTable index I/O cache miss ratiomisspercentage
postgres.table_index_io_rateTable index I/Omemory, diskB/s
postgres.table_toast_cache_io_ratioTable TOAST I/O cache miss ratiomisspercentage
postgres.table_toast_io_rateTable TOAST I/Omemory, diskB/s
postgres.table_toast_index_cache_io_ratioTable TOAST index I/O cache miss ratiomisspercentage
postgres.table_toast_index_io_rateTable TOAST index I/Omemory, diskB/s
postgres.table_scans_rateTable scansindex, sequentialscans/s
postgres.table_scans_rows_rateTable live rows fetched by scansindex, sequentialrows/s
postgres.table_autovacuum_since_timeTable time since last auto VACUUMtimeseconds
postgres.table_vacuum_since_timeTable time since last manual VACUUMtimeseconds
postgres.table_autoanalyze_since_timeTable time since last auto ANALYZEtimeseconds
postgres.table_analyze_since_timeTable time since last manual ANALYZEtimeseconds
postgres.table_null_columnsTable null columnsnullcolumns
postgres.table_sizeTable total sizesizeB
postgres.table_bloat_size_percTable bloat size percentagebloatpercentage
postgres.table_bloat_sizeTable bloat sizebloatB

Per index

These metrics refer to the table index.

Labels:

LabelDescription
databasedatabase name
schemaschema name
tabletable name
parent_tableparent table name
indexindex name

Metrics:

MetricDescriptionDimensionsUnit
postgres.index_sizeIndex sizesizeB
postgres.index_bloat_size_percIndex bloat size percentagebloatpercentage
postgres.index_bloat_sizeIndex bloat sizebloatB
postgres.index_usage_statusIndex usage statusused, unusedstatus

Alerts

The following alerts are available:

Alert nameOn metricDescription
postgres_total_connection_utilizationpostgres.connections_utilizationaverage total connection utilization over the last minute
postgres_acquired_locks_utilizationpostgres.locks_utilizationaverage acquired locks utilization over the last minute
postgres_txid_exhaustion_percpostgres.txid_exhaustion_percpercent towards TXID wraparound
postgres_db_cache_io_ratiopostgres.db_cache_io_ratioaverage cache hit ratio in db ${label:database} over the last minute
postgres_db_transactions_rollback_ratiopostgres.db_cache_io_ratioaverage aborted transactions percentage in db ${label:database} over the last five minutes
postgres_db_deadlocks_ratepostgres.db_deadlocks_ratenumber of deadlocks detected in db ${label:database} in the last minute
postgres_table_cache_io_ratiopostgres.table_cache_io_ratioaverage cache hit ratio in db ${label:database} table ${label:table} over the last minute
postgres_table_index_cache_io_ratiopostgres.table_index_cache_io_ratioaverage index cache hit ratio in db ${label:database} table ${label:table} over the last minute
postgres_table_toast_cache_io_ratiopostgres.table_toast_cache_io_ratioaverage TOAST hit ratio in db ${label:database} table ${label:table} over the last minute
postgres_table_toast_index_cache_io_ratiopostgres.table_toast_index_cache_io_ratioaverage index TOAST hit ratio in db ${label:database} table ${label:table} over the last minute
postgres_table_bloat_size_percpostgres.table_bloat_size_percbloat size percentage in db ${label:database} table ${label:table}
postgres_table_last_autovacuum_timepostgres.table_autovacuum_since_timetime elapsed since db ${label:database} table ${label:table} was vacuumed by the autovacuum daemon
postgres_table_last_autoanalyze_timepostgres.table_autoanalyze_since_timetime elapsed since db ${label:database} table ${label:table} was analyzed by the autovacuum daemon
postgres_index_bloat_size_percpostgres.index_bloat_size_percbloat size percentage in db ${label:database} table ${label:table} index ${label:index}

Live Data

This collector exposes real-time functions for interactive troubleshooting in the Live tab.

Top Queries

Retrieves aggregated SQL query performance metrics from PostgreSQL using either pg_stat_monitor (preferred) or pg_stat_statements.

The collector automatically detects which extension is available:

  • pg_stat_monitor (Percona): Enhanced statistics with additional columns like application name, client IP, CPU time, error info, and query classification
  • pg_stat_statements (standard): Core execution statistics available in all PostgreSQL installations

Statistics include execution counts, timing metrics, I/O operations, and resource consumption. Columns are dynamically detected based on your PostgreSQL version and available extension.

Use cases:

  • Identify slow queries consuming the most total execution time
  • Find queries with high shared block reads for I/O optimization
  • Analyze temp block usage to detect queries needing memory tuning
  • With pg_stat_monitor: Track queries by application, identify error patterns

Query text is truncated at 4096 characters for display purposes.

AspectDescription
NamePostgres:top-queries
Require Cloudyes
PerformanceQueries pg_stat_statements or pg_stat_monitor which maintain statistics in shared memory:
• On busy servers with many unique queries, the extension may consume significant memory
• Default limit of 500 rows balances usefulness with performance
• pg_stat_monitor uses time-based buckets which may have different memory characteristics
SecurityQuery text may contain unmasked literal values including potentially sensitive data:
• Personal information in WHERE clauses or INSERT values
• Business data and internal identifiers
• Access should be restricted to authorized personnel only
AvailabilityAvailable when:
• Either pg_stat_statements or pg_stat_monitor extension is installed
• The collector has successfully connected to PostgreSQL
• Returns HTTP 503 if no query statistics extension is installed
• Returns HTTP 500 if the query fails
• Returns HTTP 504 if the query times out

Prerequisites

Enable pg_stat_statements or pg_stat_monitor

Either pg_stat_statements (standard) or pg_stat_monitor (Percona) must be installed. The collector auto-detects which is available, preferring pg_stat_monitor when both are present.

Option 1: pg_stat_statements (standard PostgreSQL)

  1. Add to postgresql.conf:

    shared_preload_libraries = 'pg_stat_statements'
    
  2. Restart PostgreSQL, then create the extension:

    CREATE EXTENSION pg_stat_statements;
    

Option 2: pg_stat_monitor (Percona - recommended)

Provides additional columns: application name, client IP, CPU time, error tracking, and query classification.

  1. Install pg_stat_monitor (available in Percona distribution or as separate package)

  2. Add to postgresql.conf:

    shared_preload_libraries = 'pg_stat_monitor'
    
  3. Restart PostgreSQL, then create the extension:

    CREATE EXTENSION pg_stat_monitor;
    

Info

  • Both extensions require a server restart to load the shared library
  • Statistics can be reset with SELECT pg_stat_statements_reset() or SELECT pg_stat_monitor_reset()
  • Enable track_io_timing for block read/write timing metrics

Parameters

ParameterTypeDescriptionRequiredDefaultOptions
Filter ByselectSelect the primary sort column. Options include total time, mean time, calls, rows, shared blocks hit/read, and temp blocks written. Defaults to total time to focus on most resource-intensive queries.yestotalTime

Returns

Aggregated query statistics from pg_stat_statements or pg_stat_monitor. Each row represents a unique query pattern with cumulative metrics across all executions.

ColumnTypeUnitVisibilityDescription
Query IDstringhiddenInternal hash identifier for the normalized query. Can be used to track queries across statistics resets.
QuerystringNormalized SQL query text with literals replaced by parameter placeholders. Truncated to 4096 characters.
DatabasestringDatabase name where the query was executed.
UserstringPostgreSQL user who executed the query.
CallsintegerTotal number of times this query pattern has been executed. High values indicate frequently run queries.
Total TimedurationmillisecondsCumulative execution time across all executions. High values indicate queries consuming significant database resources.
Mean TimedurationmillisecondsAverage execution time per call. Use this to compare typical performance across different query patterns.
Min TimedurationmillisecondshiddenMinimum execution time observed for a single execution.
Max TimedurationmillisecondshiddenMaximum execution time observed for a single execution. Large gaps between min and max may indicate performance variability.
Stddev TimedurationmillisecondshiddenStandard deviation of execution time. High values indicate inconsistent query performance.
PlansintegerhiddenNumber of times the query was planned. Available in PostgreSQL 13+.
Total Plan TimedurationmillisecondshiddenCumulative time spent planning the query. Available in PostgreSQL 13+.
Mean Plan TimedurationmillisecondshiddenAverage time spent planning per execution. Available in PostgreSQL 13+.
Min Plan TimedurationmillisecondshiddenMinimum planning time observed. Available in PostgreSQL 13+.
Max Plan TimedurationmillisecondshiddenMaximum planning time observed. Available in PostgreSQL 13+.
Stddev Plan TimedurationmillisecondshiddenStandard deviation of planning time. Available in PostgreSQL 13+.
RowsintegerTotal number of rows retrieved or affected across all executions.
Shared Blocks HitintegerTotal shared buffer cache hits. High values indicate good cache utilization.
Shared Blocks ReadintegerTotal shared blocks read from disk. High values indicate queries that bypass the cache and may benefit from more shared_buffers.
Shared Blocks DirtiedintegerhiddenTotal shared blocks dirtied by the query.
Shared Blocks WrittenintegerhiddenTotal shared blocks written by the query.
Local Blocks HitintegerhiddenTotal local buffer cache hits (temporary tables).
Local Blocks ReadintegerhiddenTotal local blocks read from disk.
Local Blocks DirtiedintegerhiddenTotal local blocks dirtied.
Local Blocks WrittenintegerhiddenTotal local blocks written.
Temp Blocks ReadintegerTotal temp blocks read. Non-zero values indicate queries spilling to disk due to insufficient work_mem.
Temp Blocks WrittenintegerTotal temp blocks written. High values suggest increasing work_mem may improve performance.
Block Read TimedurationmillisecondsTime spent reading blocks from disk. Requires track_io_timing to be enabled.
Block Write TimedurationmillisecondsTime spent writing blocks to disk. Requires track_io_timing to be enabled.
WAL RecordsintegerhiddenTotal number of WAL records generated. Available in PostgreSQL 13+.
WAL Full Page ImagesintegerhiddenTotal number of WAL full page images generated. Available in PostgreSQL 13+.
WAL BytesintegerhiddenTotal bytes of WAL generated. Available in PostgreSQL 13+.
JIT FunctionsintegerhiddenTotal number of functions JIT-compiled. Available in PostgreSQL 15+.
JIT Generation TimedurationmillisecondshiddenTime spent generating JIT code. Available in PostgreSQL 15+.
JIT Inlining CountintegerhiddenNumber of times JIT inlining was performed. Available in PostgreSQL 15+.
JIT Inlining TimedurationmillisecondshiddenTime spent on JIT inlining. Available in PostgreSQL 15+.
JIT Optimization CountintegerhiddenNumber of times JIT optimization was performed. Available in PostgreSQL 15+.
JIT Optimization TimedurationmillisecondshiddenTime spent on JIT optimization. Available in PostgreSQL 15+.
JIT Emission CountintegerhiddenNumber of times JIT code was emitted. Available in PostgreSQL 15+.
JIT Emission TimedurationmillisecondshiddenTime spent emitting JIT code. Available in PostgreSQL 15+.
Temp Block Read TimedurationmillisecondshiddenTime spent reading temp blocks. Available in PostgreSQL 15+. Requires track_io_timing.
Temp Block Write TimedurationmillisecondshiddenTime spent writing temp blocks. Available in PostgreSQL 15+. Requires track_io_timing.
Application NamestringName of the application that executed the query. Available with pg_stat_monitor only.
Client IPstringhiddenIP address of the client that executed the query. Available with pg_stat_monitor only.
Command TypestringType of SQL command (SELECT, INSERT, UPDATE, DELETE, etc.). Available with pg_stat_monitor only.
CommentsstringhiddenSQL comments extracted from the query. Available with pg_stat_monitor only.
RelationsstringhiddenTables/relations involved in the query. Available with pg_stat_monitor only.
CPU User TimedurationmillisecondshiddenCPU time spent in user mode. Available with pg_stat_monitor only.
CPU System TimedurationmillisecondshiddenCPU time spent in system/kernel mode. Available with pg_stat_monitor only.
Error LevelintegerhiddenPostgreSQL error level if query produced an error. Available with pg_stat_monitor only.
SQL CodestringhiddenPostgreSQL SQLSTATE error code if query produced an error. Available with pg_stat_monitor only.
Error MessagestringhiddenError message if query produced an error. Available with pg_stat_monitor only.
Top LevelstringhiddenWhether this is a top-level statement (true) or nested (false). Available with pg_stat_monitor only.
Bucket Start TimestringhiddenStart time of the statistics bucket. Available with pg_stat_monitor only.

Running Queries

Retrieves currently executing queries from PostgreSQL pg_stat_activity system view.

This function queries pg_stat_activity which shows real-time information about each server process including the SQL query being executed, wait events, and session state. Unlike Top Queries which shows aggregated historical statistics, Running Queries shows live snapshots of active queries.

Use cases:

  • Identify long-running queries that may be blocking other operations
  • Debug stuck transactions or hanging connections
  • Monitor active workload during performance issues
  • Investigate wait events and lock contention in real-time

Query text is truncated at 4096 characters for display purposes.

AspectDescription
NamePostgres:running-queries
Require Cloudyes
PerformanceQueries pg_stat_activity which is a live system view:
• Very lightweight query, no impact on database performance
• Returns only active queries by default (state = ‘active’)
• Limited to 500 rows
SecurityQuery text contains actual SQL being executed, which may include:
• Personal information in WHERE clauses or INSERT values
• Business data and internal identifiers
• Access should be restricted to authorized personnel only
AvailabilityAvailable when:
• The collector has successfully connected to PostgreSQL
• Returns HTTP 503 if collector is still initializing
• Returns HTTP 500 if the query fails
• Returns HTTP 504 if the query times out

Prerequisites

Database user permissions

The monitoring user needs pg_monitor role to view all sessions:

GRANT pg_monitor TO netdata;

Without this role, the user can only see their own sessions.

Parameters

ParameterTypeDescriptionRequiredDefaultOptions
Sort ByselectSelect the sort column. Defaults to query duration (longest running first).yesdurationMs

Returns

Live query data from pg_stat_activity. Each row represents a currently active backend process.

ColumnTypeUnitVisibilityDescription
DurationdurationmillisecondsQuery duration in milliseconds (since query_start). High values indicate long-running queries.
QuerystringQuery text of the currently executing or most recent query. May be truncated at track_activity_query_size.
DatabasestringName of the database this backend is connected to.
UserstringName of the user logged into this backend.
Application NamestringName of the application connected to this backend.
Client AddressstringIP address of the client (NULL for Unix socket or internal process).
Wait EventstringSpecific wait event name if backend is currently waiting.
PIDintegerProcess ID of this backend. Use with pg_terminate_backend() to kill a query.
Wait Event TypestringhiddenType of event the backend is waiting for (Activity, BufferPin, Client, Extension, IO, IPC, Lock, LWLock, Timeout).
StatestringhiddenCurrent state: active, idle, idle in transaction, idle in transaction (aborted), fastpath function call, disabled.
Backend TypestringhiddenType of backend: client backend, autovacuum worker, parallel worker, walsender, walreceiver, etc. Available in PostgreSQL 10+.
Query StarttimestamphiddenTime when the currently active query was started.
Transaction StarttimestamphiddenTime when current transaction started (NULL if no transaction).
Backend StarttimestamphiddenTime when this process/connection started.
State ChangetimestamphiddenTime when state was last changed.
Query IDstringhiddenQuery identifier (requires compute_query_id or extension). Available in PostgreSQL 14+.
Leader PIDintegerhiddenProcess ID of parallel group leader (NULL if this is leader or not parallel). Available in PostgreSQL 13+.
Database IDintegerhiddenOID of the database this backend is connected to.
User IDintegerhiddenOID of the user logged into this backend.
Client HostnamestringhiddenHostname of the client via reverse DNS (only if log_hostname enabled).
Client PortintegerhiddenTCP port of client (-1 for Unix socket, NULL for internal process).
Backend XidstringhiddenTop-level transaction identifier of this backend.
Backend XminstringhiddenBackend’s xmin horizon.

Troubleshooting

Debug Mode

Important: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature.

To troubleshoot issues with the postgres collector, run the go.d.plugin with the debug option enabled. The output should give you clues as to why the collector isn’t working.

  • Navigate to the plugins.d directory, usually at /usr/libexec/netdata/plugins.d/. If that’s not the case on your system, open netdata.conf and look for the plugins setting under [directories].

    cd /usr/libexec/netdata/plugins.d/
    
  • Switch to the netdata user.

    sudo -u netdata -s
    
  • Run the go.d.plugin to debug the collector:

    ./go.d.plugin -d -m postgres
    

    To debug a specific job:

    ./go.d.plugin -d -m postgres -j jobName
    

Getting Logs

If you’re encountering problems with the postgres collector, follow these steps to retrieve logs and identify potential issues:

  • Run the command specific to your system (systemd, non-systemd, or Docker container).
  • Examine the output for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem.

System with systemd

Use the following command to view logs generated since the last Netdata service restart:

journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep postgres

System without systemd

Locate the collector log file, typically at /var/log/netdata/collector.log, and use grep to filter for collector’s name:

grep postgres /var/log/netdata/collector.log

Note: This method shows logs from all restarts. Focus on the latest entries for troubleshooting current issues.

Docker Container

If your Netdata runs in a Docker container named “netdata” (replace if different), use this command:

docker logs netdata 2>&1 | grep postgres

The observability platform companies need to succeed

Sign up for free

Want a personalised demo of Netdata for your use case?

Contact Sales