Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exclude-databases for collector package #697

Merged
merged 3 commits into from
Mar 5, 2023

Conversation

sysadmind
Copy link
Contributor

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 sysadmind requested a review from SuperQ October 4, 2022 02:35
@sysadmind
Copy link
Contributor Author

also, this fixes #588

@sysadmind
Copy link
Contributor Author

@SuperQ Good idea. I removed the commented code.

@macmiranda
Copy link

@sysadmind you planning on fixing the conflicts?

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 sysadmind force-pushed the exclude-database-fix branch from 44301fc to 66f6e11 Compare March 5, 2023 20:13
Signed-off-by: Joe Adams <[email protected]>
@sysadmind sysadmind force-pushed the exclude-database-fix branch from 66f6e11 to 8d6ce05 Compare March 5, 2023 20:18
@sysadmind sysadmind requested a review from SuperQ March 5, 2023 20:21
Copy link
Contributor

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more remove dead code.

Signed-off-by: Joe Adams <[email protected]>
@SuperQ SuperQ merged commit c86f549 into prometheus-community:master Mar 5, 2023
@sysadmind sysadmind deleted the exclude-database-fix branch March 5, 2023 20:44
macmiranda referenced this pull request Mar 6, 2023
* Update Go to 1.20.
* Update golanci-lint.
* Bump modules.
* Update CI orb.
* Fix up use of deprecated ioutil.

Signed-off-by: SuperQ <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants