Sign inSign up

weaponry/pgscv

By weaponry

•Updated about 5 years ago

pgSCV is a multi-purpose monitoring agent and metrics exporter for Weaponry.IO

Image
1

10K+

weaponry/pgscv repository overview

⁠pgSCV - PostgreSQL ecosystem metrics collector.
  • collects a lot of stats about system, PostgreSQL, Pgbouncers, etc.
  • exposes metrics through the HTTP /metrics endpoint in Prometheus metrics exposition format.

See details on Github⁠

⁠Usage

An example below demonstrates a typical use case when a database and pgSCV are running in separate containers.

Create example network.

docker network create example

Run postgres container.

  • Enable pg_stat_statements, it is optional.
  • Use POSTGRES_HOST_AUTH_METHOD=trust to disable authentication. Configuring security is out of the example's scope.
docker run -d --rm --name db -ti -e POSTGRES_HOST_AUTH_METHOD=trust --network example postgres:13 -c 'shared_preload_libraries=pg_stat_statements'
docker exec -ti db psql -U postgres -c 'CREATE EXTENSION pg_stat_statements'

Run pgscv container.

  • Specify Postgres connection settings using DATABASE_DSN.
  • Disable some collectors with PGSCV_DISABLE_COLLECTORS.
  • Setup listen address with PGSCV_LISTEN_ADDRESS.
  • Don't detach, it's better to see logs if something goes wrong.
docker run --rm --name pgscv -ti -e PGSCV_LISTEN_ADDRESS=0.0.0.0:9890 -e PGSCV_DISABLE_COLLECTORS="system" -e DATABASE_DSN="postgresql://postgres@db/postgres" --network example weaponry/pgscv:latest

Open the second terminal and fetch metrics using curl.

docker run --rm --name curl -ti --network example curlimages/curl http://pgscv:9890/metrics

In the end, stop containers and remove example network.

docker stop db pgscv
docker network rm example

Tag summary

Content type

Image

Digest

Size

11.1 MB

Last updated

about 5 years ago

docker pull weaponry/pgscv