pgexporter is a Prometheus exporter for PostgreSQL.
pgexporter will connect to one or more PostgreSQL instances and let you monitor
their operation.
See Metrics for a list of currently available metrics.
- Prometheus exporter
- Bridge support with a JSON feature
- Web console
- Remote management
- Transport Layer Security (TLS) v1.2+ support
- Daemon mode
- User vault
See Getting Started on how to get started with pgexporter.
See Configuration on how to configure pgexporter.
See YAML on how to configure pgexporter with custom queries.
See Web console for a brief guide and screenshots.
pgexporter makes use of
- Process model
- Shared memory model across processes
- A built-in event layer (io_uring on Linux when liburing is available, otherwise epoll; kqueue on BSD/macOS) for the main process listen loop
- Atomic operations are used to keep track of state
- The PostgreSQL native protocol v3 for its communication
See Architecture for the architecture of pgexporter.
pgexporter requires
- gcc 8+ (C17)
- cmake
- make
- liburing (Linux, optional; for io_uring backend when supported)
- OpenSSL
- systemd
- rst2man
- libyaml
dnf install git gcc cmake make openssl openssl-devel systemd systemd-devel python3-docutils libyaml libyaml-devel zlib zlib-devel libzstd libzstd-devel lz4 lz4-devel bzip2 bzip2-devel libasan libasan-static liburing-devel pkgconf-pkg-config sqlite sqlite-develAlternative clang 16+ can be used. Older Clang releases -- notably Apple Clang 15, bundled with the Xcode 15 command line tools -- reject a plain = {0} initializer on an _Atomic-qualified pointer/function-pointer type (error: incompatible integer to pointer conversion), so on macOS install a newer toolchain via brew install llvm (or update the Xcode command line tools) rather than downgrading the code to accommodate it.
The following commands will install pgexporter in the /usr/local hierarchy.
git clone https://github.com/pgexporter/pgexporter.git
cd pgexporter
mkdir build
cd build
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/usr/local ..
make
sudo make installSee RPM for how to build a RPM of pgexporter.
The following commands will create a DEBUG version of pgexporter.
git clone https://github.com/pgexporter/pgexporter.git
cd pgexporter
mkdir build
cd build
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_BUILD_TYPE=Debug ..
makeRemember to set the log_level configuration option to debug5.
Contributions to pgexporter are managed on GitHub.com
Contributions are most welcome !
Please, consult our Code of Conduct policies for interacting in our community.
Consider giving the project a star on GitHub if you find it useful.