forked from lesovsky/pgscv
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Getting started
Mikhail Grigorev edited this page Nov 26, 2024
·
16 revisions
TLDR: download and run pgSCV, scrape metrics with cURL.
-
Go to releases page and select latest release, for example v0.9.6. Copy url of
.tar.gz
archive from assets section. -
Go to the server and download and unpack archive using cURL utility.
curl -s -L https://github.com/cherts/pgscv/releases/download/v0.9.6/pgscv_0.9.6_linux_$(uname -m).tar.gz -o - | tar xzf - -C /usr/sbin pgscv
- Create 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:supersecretpassword@127.0.0.1:5432/postgres"
EOF
Instead of postgres
user you could use other user.
- 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.
- Open the second terminal and check metrics
curl -s 127.0.0.1:9890/metrics
You should see metrics in Prometheus format.