I have a running instance of in my local centos/linux environment.
I want to connect this postgres with prometheus using postgres exporter.
The postgres exporter has a flag --config.file="path-to-config/postgres_exporter.yml"
I am not able to get postgres_exporter.yml file.
Can you please point me to the sample file?
I directly ran
% DATA_SOURCE_NAME="postgresql://postgres:postgres@localhost:5432/?sslmode=disable"
% ./postgres_exporter
It works.
I am expecting:
% ./postgres_exporter --config.file="/tmp/postgres_exporter.yml"
It's not really stated clearly in the official github readme, but it's actually in the auth_modules section.
Alternatively, you can create the postgres_exporter.yml file by running the following command:
sudo bash -c 'echo "auth_modules:
my_db: # Set this to any name you want
type: userpass
userpass:
username: myusername
password: mypassword
options:
# options become key=value parameters of the DSN
sslmode: disable
" >> ./postgres_exporter.yml'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With