Skip to content

pg_datasentinel

Observability and activity monitoring extension for PostgreSQL

pg_datasentinel · Observability and activity monitoring extension for PostgreSQL

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
6400pg_datasentinelpg_datasentinel1.0STATBSD-3-ClauseC
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--sLd--NoYesYesYesnono
shared_preload_libraries = pg_datasentinel is required because the extension allocates shared memory and hooks into activity logging.

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY1.019 18 17 16 15pg_datasentinel-
RPMPIGSTY1.019 18 17 16 15pg_datasentinel_$v-
DEBPIGSTY1.019 18 17 16 15postgresql-$v-pg-datasentinel-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
el8.aarch64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
el9.x86_64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
el9.aarch64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
el10.x86_64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
el10.aarch64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
d12.x86_64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
d12.aarch64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
d13.x86_64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
d13.aarch64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
u22.x86_64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
u22.aarch64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
u24.x86_64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
u24.aarch64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
u26.x86_64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
u26.aarch64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
PackageVersionOSORGSIZEFile URL
pg_datasentinel_181.0el8.x86_64pigsty67.6 KiBpg_datasentinel_18-1.0-1PGSTY.el8.x86_64.rpm
pg_datasentinel_181.0el8.aarch64pigsty66.9 KiBpg_datasentinel_18-1.0-1PGSTY.el8.aarch64.rpm
pg_datasentinel_181.0el9.x86_64pigsty68.6 KiBpg_datasentinel_18-1.0-1PGSTY.el9.x86_64.rpm
pg_datasentinel_181.0el9.aarch64pigsty69.0 KiBpg_datasentinel_18-1.0-1PGSTY.el9.aarch64.rpm
pg_datasentinel_181.0el10.x86_64pigsty69.3 KiBpg_datasentinel_18-1.0-1PGSTY.el10.x86_64.rpm
pg_datasentinel_181.0el10.aarch64pigsty69.8 KiBpg_datasentinel_18-1.0-1PGSTY.el10.aarch64.rpm
postgresql-18-pg-datasentinel1.0d12.x86_64pigsty59.0 KiBpostgresql-18-pg-datasentinel_1.0-1PGSTY~bookworm_amd64.deb
postgresql-18-pg-datasentinel1.0d12.aarch64pigsty59.1 KiBpostgresql-18-pg-datasentinel_1.0-1PGSTY~bookworm_arm64.deb
postgresql-18-pg-datasentinel1.0d13.x86_64pigsty59.2 KiBpostgresql-18-pg-datasentinel_1.0-1PGSTY~trixie_amd64.deb
postgresql-18-pg-datasentinel1.0d13.aarch64pigsty59.2 KiBpostgresql-18-pg-datasentinel_1.0-1PGSTY~trixie_arm64.deb
postgresql-18-pg-datasentinel1.0u22.x86_64pigsty63.3 KiBpostgresql-18-pg-datasentinel_1.0-1PGSTY~jammy_amd64.deb
postgresql-18-pg-datasentinel1.0u22.aarch64pigsty63.8 KiBpostgresql-18-pg-datasentinel_1.0-1PGSTY~jammy_arm64.deb
postgresql-18-pg-datasentinel1.0u24.x86_64pigsty61.5 KiBpostgresql-18-pg-datasentinel_1.0-1PGSTY~noble_amd64.deb
postgresql-18-pg-datasentinel1.0u24.aarch64pigsty62.4 KiBpostgresql-18-pg-datasentinel_1.0-1PGSTY~noble_arm64.deb
postgresql-18-pg-datasentinel1.0u26.x86_64pigsty61.3 KiBpostgresql-18-pg-datasentinel_1.0-1PGSTY~resolute_amd64.deb
postgresql-18-pg-datasentinel1.0u26.aarch64pigsty61.6 KiBpostgresql-18-pg-datasentinel_1.0-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_datasentinel_171.0el8.x86_64pigsty67.5 KiBpg_datasentinel_17-1.0-1PGSTY.el8.x86_64.rpm
pg_datasentinel_171.0el8.aarch64pigsty66.9 KiBpg_datasentinel_17-1.0-1PGSTY.el8.aarch64.rpm
pg_datasentinel_171.0el9.x86_64pigsty68.5 KiBpg_datasentinel_17-1.0-1PGSTY.el9.x86_64.rpm
pg_datasentinel_171.0el9.aarch64pigsty69.1 KiBpg_datasentinel_17-1.0-1PGSTY.el9.aarch64.rpm
pg_datasentinel_171.0el10.x86_64pigsty69.3 KiBpg_datasentinel_17-1.0-1PGSTY.el10.x86_64.rpm
pg_datasentinel_171.0el10.aarch64pigsty69.8 KiBpg_datasentinel_17-1.0-1PGSTY.el10.aarch64.rpm
postgresql-17-pg-datasentinel1.0d12.x86_64pigsty58.9 KiBpostgresql-17-pg-datasentinel_1.0-1PGSTY~bookworm_amd64.deb
postgresql-17-pg-datasentinel1.0d12.aarch64pigsty59.0 KiBpostgresql-17-pg-datasentinel_1.0-1PGSTY~bookworm_arm64.deb
postgresql-17-pg-datasentinel1.0d13.x86_64pigsty59.1 KiBpostgresql-17-pg-datasentinel_1.0-1PGSTY~trixie_amd64.deb
postgresql-17-pg-datasentinel1.0d13.aarch64pigsty59.2 KiBpostgresql-17-pg-datasentinel_1.0-1PGSTY~trixie_arm64.deb
postgresql-17-pg-datasentinel1.0u22.x86_64pigsty72.0 KiBpostgresql-17-pg-datasentinel_1.0-1PGSTY~jammy_amd64.deb
postgresql-17-pg-datasentinel1.0u22.aarch64pigsty72.5 KiBpostgresql-17-pg-datasentinel_1.0-1PGSTY~jammy_arm64.deb
postgresql-17-pg-datasentinel1.0u24.x86_64pigsty61.5 KiBpostgresql-17-pg-datasentinel_1.0-1PGSTY~noble_amd64.deb
postgresql-17-pg-datasentinel1.0u24.aarch64pigsty62.4 KiBpostgresql-17-pg-datasentinel_1.0-1PGSTY~noble_arm64.deb
postgresql-17-pg-datasentinel1.0u26.x86_64pigsty61.3 KiBpostgresql-17-pg-datasentinel_1.0-1PGSTY~resolute_amd64.deb
postgresql-17-pg-datasentinel1.0u26.aarch64pigsty61.6 KiBpostgresql-17-pg-datasentinel_1.0-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_datasentinel_161.0el8.x86_64pigsty67.5 KiBpg_datasentinel_16-1.0-1PGSTY.el8.x86_64.rpm
pg_datasentinel_161.0el8.aarch64pigsty66.9 KiBpg_datasentinel_16-1.0-1PGSTY.el8.aarch64.rpm
pg_datasentinel_161.0el9.x86_64pigsty68.4 KiBpg_datasentinel_16-1.0-1PGSTY.el9.x86_64.rpm
pg_datasentinel_161.0el9.aarch64pigsty69.1 KiBpg_datasentinel_16-1.0-1PGSTY.el9.aarch64.rpm
pg_datasentinel_161.0el10.x86_64pigsty69.3 KiBpg_datasentinel_16-1.0-1PGSTY.el10.x86_64.rpm
pg_datasentinel_161.0el10.aarch64pigsty69.8 KiBpg_datasentinel_16-1.0-1PGSTY.el10.aarch64.rpm
postgresql-16-pg-datasentinel1.0d12.x86_64pigsty58.9 KiBpostgresql-16-pg-datasentinel_1.0-1PGSTY~bookworm_amd64.deb
postgresql-16-pg-datasentinel1.0d12.aarch64pigsty59.0 KiBpostgresql-16-pg-datasentinel_1.0-1PGSTY~bookworm_arm64.deb
postgresql-16-pg-datasentinel1.0d13.x86_64pigsty59.1 KiBpostgresql-16-pg-datasentinel_1.0-1PGSTY~trixie_amd64.deb
postgresql-16-pg-datasentinel1.0d13.aarch64pigsty59.1 KiBpostgresql-16-pg-datasentinel_1.0-1PGSTY~trixie_arm64.deb
postgresql-16-pg-datasentinel1.0u22.x86_64pigsty71.5 KiBpostgresql-16-pg-datasentinel_1.0-1PGSTY~jammy_amd64.deb
postgresql-16-pg-datasentinel1.0u22.aarch64pigsty72.1 KiBpostgresql-16-pg-datasentinel_1.0-1PGSTY~jammy_arm64.deb
postgresql-16-pg-datasentinel1.0u24.x86_64pigsty61.6 KiBpostgresql-16-pg-datasentinel_1.0-1PGSTY~noble_amd64.deb
postgresql-16-pg-datasentinel1.0u24.aarch64pigsty62.4 KiBpostgresql-16-pg-datasentinel_1.0-1PGSTY~noble_arm64.deb
postgresql-16-pg-datasentinel1.0u26.x86_64pigsty61.3 KiBpostgresql-16-pg-datasentinel_1.0-1PGSTY~resolute_amd64.deb
postgresql-16-pg-datasentinel1.0u26.aarch64pigsty61.6 KiBpostgresql-16-pg-datasentinel_1.0-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_datasentinel_151.0el8.x86_64pigsty67.6 KiBpg_datasentinel_15-1.0-1PGSTY.el8.x86_64.rpm
pg_datasentinel_151.0el8.aarch64pigsty66.9 KiBpg_datasentinel_15-1.0-1PGSTY.el8.aarch64.rpm
pg_datasentinel_151.0el9.x86_64pigsty68.8 KiBpg_datasentinel_15-1.0-1PGSTY.el9.x86_64.rpm
pg_datasentinel_151.0el9.aarch64pigsty69.3 KiBpg_datasentinel_15-1.0-1PGSTY.el9.aarch64.rpm
pg_datasentinel_151.0el10.x86_64pigsty69.7 KiBpg_datasentinel_15-1.0-1PGSTY.el10.x86_64.rpm
pg_datasentinel_151.0el10.aarch64pigsty69.9 KiBpg_datasentinel_15-1.0-1PGSTY.el10.aarch64.rpm
postgresql-15-pg-datasentinel1.0d12.x86_64pigsty59.2 KiBpostgresql-15-pg-datasentinel_1.0-1PGSTY~bookworm_amd64.deb
postgresql-15-pg-datasentinel1.0d12.aarch64pigsty59.2 KiBpostgresql-15-pg-datasentinel_1.0-1PGSTY~bookworm_arm64.deb
postgresql-15-pg-datasentinel1.0d13.x86_64pigsty59.3 KiBpostgresql-15-pg-datasentinel_1.0-1PGSTY~trixie_amd64.deb
postgresql-15-pg-datasentinel1.0d13.aarch64pigsty59.4 KiBpostgresql-15-pg-datasentinel_1.0-1PGSTY~trixie_arm64.deb
postgresql-15-pg-datasentinel1.0u22.x86_64pigsty71.8 KiBpostgresql-15-pg-datasentinel_1.0-1PGSTY~jammy_amd64.deb
postgresql-15-pg-datasentinel1.0u22.aarch64pigsty72.3 KiBpostgresql-15-pg-datasentinel_1.0-1PGSTY~jammy_arm64.deb
postgresql-15-pg-datasentinel1.0u24.x86_64pigsty61.8 KiBpostgresql-15-pg-datasentinel_1.0-1PGSTY~noble_amd64.deb
postgresql-15-pg-datasentinel1.0u24.aarch64pigsty62.7 KiBpostgresql-15-pg-datasentinel_1.0-1PGSTY~noble_arm64.deb
postgresql-15-pg-datasentinel1.0u26.x86_64pigsty61.6 KiBpostgresql-15-pg-datasentinel_1.0-1PGSTY~resolute_amd64.deb
postgresql-15-pg-datasentinel1.0u26.aarch64pigsty61.8 KiBpostgresql-15-pg-datasentinel_1.0-1PGSTY~resolute_arm64.deb

Source

pig build pkg pg_datasentinel;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install pg_datasentinel;		# install by package name

pig install pg_datasentinel -v 18;   # install for PG 18
pig install pg_datasentinel -v 17;   # install for PG 17
pig install pg_datasentinel -v 16;   # install for PG 16
pig install pg_datasentinel -v 15;   # install for PG 15

Config this extension to shared_preload_libraries:

shared_preload_libraries = 'pg_datasentinel';

Create this extension with:

CREATE EXTENSION pg_datasentinel;

Usage

Source: README, Release 1.0

pg_datasentinel adds observability views on top of PostgreSQL activity, maintenance, temporary-file, checkpoint, wraparound, and container resource data. It must be preloaded because it allocates shared memory and hooks into activity logging.

Required setup

-- postgresql.conf
shared_preload_libraries = 'pg_datasentinel'
log_autovacuum_min_duration = 0
log_temp_files = 0
log_checkpoints = on

CREATE EXTENSION pg_datasentinel;

Main views

  • ds_stat_activity: extends pg_stat_activity with backend RSS, optional PSS, temp-file bytes, and plan_id on PostgreSQL 18+.
  • ds_container_resources: reports cgroup CPU and memory limits plus current usage.
  • ds_wraparound_risk: estimates XID and MXID ETA to aggressive vacuum and wraparound from hourly snapshots.
  • ds_xid_snapshots: raw snapshot history used by ds_wraparound_risk.
  • ds_vacuum_activity, ds_analyze_activity, ds_tempfile_activity, ds_checkpoint_activity: shared-memory ring buffers for maintenance and checkpoint events.
  • ds_activity_summary: one-row summary of ring-buffer occupancy and timestamps.

Useful GUCs

  • pg_datasentinel.enabled: enables or disables capture.
  • pg_datasentinel.max_entries: ring-buffer capacity per activity stream; restart required.
  • pg_datasentinel.maintenance_force_verbose: adds VERBOSE to manual VACUUM and ANALYZE so they are captured.
  • pg_datasentinel.ignore_system_schemas: suppresses pg_catalog and information_schema noise.
  • pg_datasentinel.enable_pss_memory: reads /proc/*/smaps_rollup for per-backend PSS.

Caveats

  • PostgreSQL 15+ is required upstream.
  • Memory and temp-file enrichment depends on Linux /proc; container metrics depend on cgroups.
  • Vacuum and analyze parsing depends on English log keywords, so translated server message locales are not fully supported.
  • plan_id is only populated on PostgreSQL 18+, and is most useful when paired with the official pg_store_plans fork linked from the README.

Table reader