Getting started - cherts/pgscv GitHub Wiki

Getting started with pgSCV.

TLDR: download and run pgSCV, scrape metrics with cURL.

  1. Go to the server and install required dependencies:
apt-get update && apt-get install jq curl tar gzip
  1. Go to the server and download and unpack latest archive using cURL utility:
LATEST_VER=$(curl https://api.github.com/repos/cherts/pgscv/releases/latest 2>/dev/null | jq -r .tag_name | sed 's/[^0-9.]//g') && \
curl -s -L https://github.com/cherts/pgscv/releases/download/v${LATEST_VER}/pgscv_${LATEST_VER}_linux_$(uname -m).tar.gz -o - | tar xzf - -C /usr/sbin pgscv
  1. Create minimal config file where you need to specify credentials for connecting to PostgreSQL.
cat << EOF > /etc/pgscv.yaml
services:
  "postgres:5432":
    service_type: "postgres"
    conninfo: "postgres://postgres:[email protected]:5432/postgres"
EOF

Instead of postgres user you could use other user.

  1. Run pgSCV
/usr/sbin/pgscv --config-file=/etc/pgscv.yaml

You should see no error. After startup pgSCV connecting to PostgreSQL service using provided credentials.

  1. Open the second terminal and check metrics
curl -s 127.0.0.1:9890/metrics

You should see metrics in Prometheus format.

⚠️ **GitHub.com Fallback** ⚠️