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

Support excluding specific postgresql databases from stats collection #29605

Merged
merged 5 commits into from Dec 6, 2023

Conversation

recht
Copy link
Contributor

@recht recht commented Dec 1, 2023

Description:
There are cases where all except a few databases should be collected, for example the rdsadmin database in Amazon RDS is not accessible to regular users. This PR adds an exclude_databases config setting to the psql collector where it's possible to specify a list of databases that should be excluded.

Testing:

Unit tests added

Documentation:

Readme updated with new config setting

@recht recht requested review from djaglowski and a team as code owners December 1, 2023 15:32
Copy link

linux-foundation-easycla bot commented Dec 1, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me and implementation appears clean. However, I think this kind of functionality warrants a test which validates an expected result.

receiver/postgresqlreceiver/scraper_test.go Show resolved Hide resolved
Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

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

Thanks @recht. Just one more simple suggestion but this looks good to me.

receiver/postgresqlreceiver/scraper.go Outdated Show resolved Hide resolved
There are cases where all except a few databases should be collected, for example the `rdsadmin` database in Amazon RDS is not accessible to regular users.
@djaglowski djaglowski added the ready to merge Code review completed; ready to merge by maintainers label Dec 6, 2023
@djaglowski djaglowski merged commit 30e756e into open-telemetry:main Dec 6, 2023
79 checks passed
@github-actions github-actions bot added this to the next release milestone Dec 6, 2023
@recht recht deleted the exclude branch December 6, 2023 21:26
jayasai470 pushed a commit to jayasai470/opentelemetry-collector-contrib that referenced this pull request Dec 8, 2023
…open-telemetry#29605)

**Description:**
There are cases where all except a few databases should be collected,
for example the `rdsadmin` database in Amazon RDS is not accessible to
regular users. This PR adds an `exclude_databases` config setting to the
psql collector where it's possible to specify a list of databases that
should be excluded.

**Testing:**

Unit tests added

**Documentation:** 

Readme updated with new config setting

---------

Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Code review completed; ready to merge by maintainers receiver/postgresql
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants