pg_prometheus
pg_prometheus · Prometheus metric sample type and helpers for PostgreSQL.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100023 | pg_prometheus | pg_prometheus | 0.2.2 | STAT | Apache-2.0 | C |
| Relationships | |
|---|---|
| Requires | plpgsql |
Usage
Sources:
- Archived upstream README and sunset notice
- Pinned extension SQL
- Pinned sample parser
- Pinned extension control file
pg_prometheus version 0.2.2 defines a prom_sample type for Prometheus exposition-format samples and creates raw or normalized PostgreSQL storage with query views. It was designed for the old Prometheus PostgreSQL remote-storage adapter, with optional TimescaleDB hypertables.
Create and query storage
Upstream requires the library in shared_preload_libraries and a server restart before installation:
Normalized storage separates label sets from timestamp/value rows; raw storage keeps each complete prom_sample. The helper creates several tables, indexes, views, and triggers in the caller’s schema. COPY integrations use the generated copy table rather than the view.
Archived integration
Timescale archived this repository after putting it in sunset and maintenance mode. The reviewed source last changed in 2020, its Docker example targets PostgreSQL 11, and both the adapter and TimescaleDB integration reflect that era. The README points to a successor project, but that does not make this extension current.
Treat pg_prometheus as a legacy data format and migration source. Validate its C parser with untrusted exposition input, inspect all generated object names and privileges, define explicit retention and partition management, and measure label-cardinality growth. Do not deploy the old adapter or archived container without a complete security, compatibility, and migration review.