pgSCV is a multi-purpose monitoring agent and metrics exporter for Weaponry.IO
10K+
See details on Github
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.
pg_stat_statements, it is optional.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.
DATABASE_DSN.PGSCV_DISABLE_COLLECTORS.PGSCV_LISTEN_ADDRESS.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
Content type
Image
Digest
Size
11.1 MB
Last updated
about 5 years ago
docker pull weaponry/pgscv