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

Allow proxy service work without metrics DB to allow db drop #97

Merged
merged 48 commits into from
Sep 16, 2024

Conversation

boodyvo
Copy link
Contributor

@boodyvo boodyvo commented Sep 13, 2024

  • Added variable to disable dependency for the database. With the new variable METRIC_DATABASE_ENABLED=false we can run proxy without database dependency.
  • Refactored database usage by creating interface and providing two implementations: noop (to use when metrics is disabled) and postgres (current implementation of db)
  • Added a CI without database to test dependency.
  • Added separate set of E2E tests to validate same E2E test set runs ok, if we remove dependency for metrics checks.

"time"
)

const (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Migrated partition part of the code into database, as it is based on the implementation details of the db itself

@@ -0,0 +1,41 @@
package empty
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Empty implementation, that will be used in case of metric database disabled

clients/database/empty/database.go Outdated Show resolved Hide resolved
clients/database/postgres/migrate.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
routines/metric_pruning.go Outdated Show resolved Hide resolved
@boodyvo boodyvo requested a review from drklee3 September 16, 2024 18:44
Copy link
Member

@drklee3 drklee3 left a comment

Choose a reason for hiding this comment

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

lgm! great improvement from the previous changes

also please update the pr title / commit message before merge to be more a bit more descriptive & follow conventional commits 😃

main.go Outdated Show resolved Hide resolved
@boodyvo boodyvo changed the title Refactor metric db Allow proxy service work without metrics DB to allow db drop Sep 16, 2024
@boodyvo boodyvo merged commit 2473a21 into main Sep 16, 2024
5 checks passed
@boodyvo boodyvo deleted the refactor-metric-db branch September 16, 2024 20:35
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.

2 participants