Describe the bug
Pgscv ignores databases regular expression when tries to discover pg_stat_statements extension. https://github.com/lesovsky/pgscv/blob/master/internal/collector/config.go#L185
Steps to reproduce
Add aws rds to dictionary services.
Expected behavior
Pgscv should check that database match with regex on pg_stat_statements discovering before connecting to this database.
pgSCV startup options
Config file
listen_address: 127.0.0.1:9890
autoupdate: off
no_track_mode: false
databases: "^(app_database_1|app_database_2)$"
services:
"aws_rds":
service_type: "postgres"
conninfo: "postgres://pgscv:XXXXXX@rds-host/postgres"
Errors and Logs
Aws rds logs
2022-11-12 17:00:54 UTC:10.2.10.20(49376):pgscv@rdsadmin:[28030]:FATAL: pg_hba.conf rejects connection for host "X.X.X.X", user "pgscv", database "rdsadmin", SSL on
Pgscv logs
{"level":"warn","service":"pgscv","time":"2022-11-17T14:00:55Z","message":"connect to database 'rdsadmin' failed: failed to connect to `host=rds-host user=pgscv database=rdsadmin`: server error (FATAL: pg_hba.conf rejects connection for host \"X.X.X.X\", user \"pgscv\", database \"rdsadmin\", SSL on (SQLSTATE 28000)); skip"}
Additional context
It's not critical issue, but such kind of behavior creates a lot of flood in aws rds logs and it's not possible to fix it.