how to do on one exporter to monitor a lot of postgresql instance?
Hello, I want to use one exporter to monitor a lot of postgresql instance, what do i do?
I use the script to start the postgres_exporter,but It's just can monitor one instance, what do i do ,if i want to monitor many instnace?
cd /home/postgres/tools/postgres_exporter_v0.8.0_linux-amd64 export PATH=/etc/postgresql/debug_11.6/bin:$PATH export HOSTNAME=10.11.100.192 export DATA_SOURCE_NAME="user=*** host=$HOSTNAME password=**** port=5432 dbname=testdb sslmode=disable" export PG_EXPORTER_EXTEND_QUERY_PATH="/etc/grafana/plugins/postgres_exporter/queries-11.yaml" nohup ./postgres_exporter --web.listen-address=":9187" >/dev/null 2>&1 &
@xionglang I do something like this - but running from a docker container in k8s. ( See also https://github.com/wrouesnel/postgres_exporter/issues/267)
DATA_SOURCE_NAME="postgresql://user:[email protected]/dbname?sslmode=disable,postgresql://user:[email protected]/dbname2?sslmode=disable"
Be aware that if one of the monitoring databases not will respond, the exporter will hang and you will not get data from your other monitored databases - e.g see https://github.com/wrouesnel/postgres_exporter/issues/388 and https://github.com/wrouesnel/postgres_exporter/issues/419
@eskytthe Thank you very much. But I thinks it's not good methods. Do you have plan to split the connection strings to different process? Every process to use different connection string.
DATA_SOURCE_NAME="postgresql://user:[email protected]/dbname?sslmode=disable,postgresql://user:[email protected]/dbname2?sslmode=disable"
Does this work for version 0.10.0 release? In older releases parsing the string as above worked fine but it seems not in the latest version.