-
Notifications
You must be signed in to change notification settings - Fork 32
🎨Ensure all DB clients have a sensible name #8220
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
🎨Ensure all DB clients have a sensible name #8220
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8220 +/- ##
==========================================
- Coverage 88.08% 88.02% -0.07%
==========================================
Files 1910 1522 -388
Lines 73492 61803 -11689
Branches 1301 688 -613
==========================================
- Hits 64734 54399 -10335
+ Misses 8371 7162 -1209
+ Partials 387 242 -145
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR standardizes database client naming conventions across all microservices by ensuring that every DB connection includes a descriptive application name and database driver suffix. The naming convention follows the pattern APP_NAME-HOST_NAME-TASK_SLOT-TYPE, which improves observability by making database connections easily identifiable in admin tools like Adminer.
Key changes include:
- Updating all database connection methods to accept and use
application_nameparameter - Modifying
PostgresSettingsto generate client names with configurable suffixes - Ensuring backward compatibility while making application names mandatory for new connections
Reviewed Changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
packages/settings-library/src/settings_library/postgres.py |
Enhanced PostgresSettings with new methods for generating client names with suffixes |
packages/service-library/src/servicelib/db_asyncpg_utils.py |
Updated async engine creation functions to require and use application names |
packages/service-library/src/servicelib/fastapi/db_asyncpg_engine.py |
Modified FastAPI DB connection to pass application names through |
packages/simcore-sdk/src/simcore_sdk/node_ports_common/dbmanager.py |
Updated DBManager and DBContextManager to require application names |
services/*/src/*/modules/db/*.py |
Updated all service DB modules to provide APP_NAME when connecting |
services/*/src/*/*.py |
Various service files updated to pass application names to DB connections |
Comments suppressed due to low confidence (1)
services/director-v2/tests/integration/02/test_dynamic_sidecar_nodeports_integration.py:36
- The removal of the unused import
ProjectIDStris good, but this change appears unrelated to the main purpose of this PR which is about database client naming.
ProjectID,
...dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_db.py
Outdated
Show resolved
Hide resolved
...dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_db.py
Outdated
Show resolved
Hide resolved
services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/database.py
Outdated
Show resolved
Hide resolved
🧪 CI InsightsHere's what we observed from your CI run for 12a8d97. ✅ Passed Jobs With Interesting Signals
|
mrnicegyu11
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx
bisgaard-itis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I suggest to use a symbol different from - to separate the different components of the name because it seems we already use - within our names a lot.
2588e4e to
88c8e65
Compare
GitHK
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, just a minor thing
...ic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_manager.py
Outdated
Show resolved
Hide resolved
...ic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_manager.py
Outdated
Show resolved
Hide resolved
4014201 to
12a8d97
Compare
|



What do these changes do?
This PR ensures that all DB clients are registering themselves with the application name, and a suffix as to which library is used to connect (e.g. aiopg or asyncpg). These client names are visible in the process list in adminer for example.
Typical connection is
APP_NAME-HOST_NAME-TASK_SLOT-TYPERelated issue/s
How to test
Dev-ops