pgscv

module
v0.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2025 License: BSD-3-Clause

README

pgSCV - PostgreSQL ecosystem metrics collector

Go GitHub Release GitHub downloads total) GitHub Downloads (all assets, latest release) Docker pulls) LICENSE

По-русски / In Russian

pgSCV

IMPORTANT NOTES This project is a continuation of the development of the original pgSCV by Alexey Lesovsky

Features
  • Supported services: support collecting metrics of PostgreSQL, Pgbouncer and Patroni.
  • OS metrics: support collecting metrics of operating system (only Linux).
  • Discovery and monitoring Cloud Managed Databases: Yandex Managed Service for PostgreSQL (see documentation).
  • Support Prometheus service discovery. /targets endpoint is used to discover all monitoring services (see documentation)
  • Throttling support The throttling allows limiting calls to the /metrics and /metrics?target=xxx endpoints to protect databases from a flood of monitoring requests from multiple collection agents (see documentation).
  • Concurrency limitting support It is possible to limit the parallel collection of monitoring data from the database to control the load created by the exporter. (see documentatio).
  • TLS and authentication. /metrics and и /metrics?target=xxx endpoint could be protected with basic authentication and TLS.
  • Collecting metrics from multiple services. pgSCV can collect metrics from many databases instances.
  • User-defined metrics. pgSCV could be configured in a way to collect metrics defined by user.
  • Collectors management. Collectors could be disabled if necessary.
  • Collectors filters. Collectors could be adjusted to skip collecting metrics based on labels values, like block devices, network interfaces, filesystems, users, databases, etc.
Requirements
  • Can run on Linux only; can connect to remote services running on other OS/PaaS.
  • Requisites for connecting to the services, such as login and password.
  • Database user should have privileges for executing stats functions and reading views. For more details see security considerations.
Quick start

Download the archive from releases. Unpack the archive. Create minimum config file. Start pgSCV systemd service under postgres user.

curl -s -L https://github.com/cherts/pgscv/releases/download/v0.15.1/pgscv_0.15.1_linux_$(uname -m).tar.gz -o - | tar xzf - -C /tmp && \
mv /tmp/pgscv.yaml /etc && \
mv /tmp/pgscv.service /etc/systemd/system &&  \
mv /tmp/pgscv.default /etc/default/pgscv && \
mv /tmp/pgscv /usr/sbin && \
chown postgres:postgres /etc/pgscv.yaml && \
chmod 640 /etc/pgscv.yaml && \
systemctl daemon-reload && \
systemctl enable pgscv --now

or using Docker, use DATABASE_DSN for setting up a connection to PostgreSQL:

docker pull cherts/pgscv:latest
docker run -ti -d --name pgscv \
   -e PGSCV_LISTEN_ADDRESS=0.0.0.0:9890 \
   -e PGSCV_DISABLE_COLLECTORS="system" \
   -e DATABASE_DSN="postgresql://postgres:password@dbhost:5432/postgres" \
   -p 9890:9890 \
   --restart=always \
   cherts/pgscv:latest

or using Docker, save deploy/pgscv.yaml config file to local directory /etc/pgscv:

docker pull cherts/pgscv:latest
docker run -ti -d --name pgscv \
   -v /etc/pgscv:/etc/app \
   -p 9890:9890 \
   --restart=always \
   cherts/pgscv:latest \
   --config-file=/etc/app/pgscv.yaml

or using Docker-compose, edit file docker-compose.yaml for setting up a connection to PostgreSQL:

mkdir ~/pgscv
curl -s -L https://raw.githubusercontent.com/cherts/pgscv/refs/heads/release/0.15/deploy/docker-compose.yaml -o ~/pgscv/docker-compose.yaml && cd ~/pgscv
docker-compose up -d

When pgSCV has been started it is ready to accept HTTP requests at http://127.0.0.1:9890/metrics.

or using k8s deployment

curl -s -L https://raw.githubusercontent.com/cherts/pgscv/refs/heads/release/0.15/deploy/deployment.yaml -o ~/deployment.yaml
kubectl apply -f ~/deployment.yaml

or using k8s helm chart

git clone https://github.com/cherts/pgscv.git && cd pgscv
kubectl create ns pgscv-ns
helm install -n pgscv-ns pgscv deploy/helm-chart/
Complete setup

Checkout complete setup guide.

Documentation

For further documentation see wiki.

Grafana dashboards

See directory deploy/grafana or use Grafana Lab repo:

Support and feedback

If you need help using pgSCV feel free to open discussion via email or Telegram @cherts or create an issue

Development and contribution

To help development you are encouraged to:

  • provide feedback via email or Telegram @cherts or create an issue
  • pull requests for new features
  • star the project
Star History

Star History Chart

Current developer and maintaner
Current contributors
Authors of original version
License

BSD-3. See LICENSE for more details.

Directories

Path Synopsis
Package main is a pgSCV main package
Package main is a pgSCV main package
Package discovery is main package of service discovery module
Package discovery is main package of service discovery module
factory
Package factory create service discovery from config
Package factory create service discovery from config
log
Package log using for logging SD event
Package log using for logging SD event
internal
collector
Package collector is a pgSCV collectors
Package collector is a pgSCV collectors
discovery/cloud/yandex
Package yandex implements getter for YC MDB PostgreSQL clusters, hosts and databases
Package yandex implements getter for YC MDB PostgreSQL clusters, hosts and databases
discovery/mapops
Package mapops implement join ops
Package mapops implement join ops
discovery/service
Package service is package of service discovery module
Package service is package of service discovery module
filter
Package filter is a pgSCV filter
Package filter is a pgSCV filter
http
Package http is a pgSCV http helper
Package http is a pgSCV http helper
log
Package log is a pgSCV logger
Package log is a pgSCV logger
model
Package model is a pgSCV model
Package model is a pgSCV model
pgscv
Package pgscv is a pgSCV main helper
Package pgscv is a pgSCV main helper
service
Package service is a pgSCV service helper
Package service is a pgSCV service helper
store
Package store is a pgSCV database helper
Package store is a pgSCV database helper

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL