postgres_exporter icon indicating copy to clipboard operation
postgres_exporter copied to clipboard

Fix exclude-databases for collector package

Open sysadmind opened this issue 2 years ago • 1 comments

The pg_database collector was not respecting the --exclude-databases flag and causing problems where databases were not accessible. This now respects the list of databases to exclude.

  • Adjusts the Collector create func to take a config struct instead of a logger. This allows more changes like this in the future. I figured we would need to do this at some point but I wasn't sure if we could hold off.
  • Split the database size collection to a separate query when database is not excluded.
  • Comment some probe code that was not useful/accurate

Signed-off-by: Joe Adams [email protected]

sysadmind avatar Oct 04 '22 02:10 sysadmind

also, this fixes #588

sysadmind avatar Oct 04 '22 02:10 sysadmind

@SuperQ Good idea. I removed the commented code.

sysadmind avatar Oct 17 '22 23:10 sysadmind

@sysadmind you planning on fixing the conflicts?

macmiranda avatar Mar 02 '23 08:03 macmiranda