chore: add structured lifecycle logging to postgres configstore and logstore initialization - #4409
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbitChores
WalkthroughStructured ChangesPostgres Store Startup Logging
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Comment |
Confidence Score: 4/5Safe to merge after adding the missing error log before the ApplyPoolTuning return in logstore — a one-line fix. The configstore side is complete and correct. In the logstore, every error-return path now logs except the ApplyPoolTuning failure — the only silent early-return in the function. A pool-tuning failure during logstore startup would produce no diagnostic output, directly contradicting the purpose of this change. framework/logstore/postgres.go — the ApplyPoolTuning failure path (lines 149-152) needs a logger.Error before return. Important Files Changed
Reviews (5): Last reviewed commit: "chore: adds more verbose logs for config..." | Re-trigger Greptile |
87dad4a to
70b64d9
Compare
527a36c to
536a898
Compare
70b64d9 to
a252d00
Compare
Merge activity
|
536a898 to
d55841b
Compare
a252d00 to
0f474cb
Compare
The base branch was changed.
…ogstore initialization (#4409) ## Summary Adds structured, step-by-step info and error logging throughout the Postgres initialization path for both the config store and log store. This makes it significantly easier to diagnose startup hangs or failures — particularly when the database host is unreachable, migrations are blocked on an advisory lock, or connection pool setup fails. ## Changes - Added `Info` log lines at each major stage of Postgres store initialization: target host/port/db/sslmode, migration pool open, migration execution, migration pool close, runtime pool open, pool tuning, plaintext row encryption, and final ready state. - Added `Error` log lines immediately before returning errors so failures are surfaced with context rather than silently propagated. - Log messages include actionable hints (e.g., "if this step hangs, the database host/port is likely unreachable", "may block on a cross-node advisory lock if another pod is migrating"). ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [x] Chore/CI ## Affected areas - [x] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs ## How to test Start the service pointed at a Postgres instance and observe logs during startup. Verify that each initialization stage emits the expected log lines. To test error paths, point the service at an unreachable host and confirm the error log is emitted before the process exits. ```sh go test ./framework/configstore/... ./framework/logstore/... ``` ## Breaking changes - [ ] Yes - [x] No ## Security considerations The connection info logged (host, port, db name, SSL mode) does not include credentials. Passwords are not logged. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [ ] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable
…ogstore initialization (maximhq#4409) ## Summary Adds structured, step-by-step info and error logging throughout the Postgres initialization path for both the config store and log store. This makes it significantly easier to diagnose startup hangs or failures — particularly when the database host is unreachable, migrations are blocked on an advisory lock, or connection pool setup fails. ## Changes - Added `Info` log lines at each major stage of Postgres store initialization: target host/port/db/sslmode, migration pool open, migration execution, migration pool close, runtime pool open, pool tuning, plaintext row encryption, and final ready state. - Added `Error` log lines immediately before returning errors so failures are surfaced with context rather than silently propagated. - Log messages include actionable hints (e.g., "if this step hangs, the database host/port is likely unreachable", "may block on a cross-node advisory lock if another pod is migrating"). ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [x] Chore/CI ## Affected areas - [x] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs ## How to test Start the service pointed at a Postgres instance and observe logs during startup. Verify that each initialization stage emits the expected log lines. To test error paths, point the service at an unreachable host and confirm the error log is emitted before the process exits. ```sh go test ./framework/configstore/... ./framework/logstore/... ``` ## Breaking changes - [ ] Yes - [x] No ## Security considerations The connection info logged (host, port, db name, SSL mode) does not include credentials. Passwords are not logged. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [ ] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable
…ogstore initialization (maximhq#4409) ## Summary Adds structured, step-by-step info and error logging throughout the Postgres initialization path for both the config store and log store. This makes it significantly easier to diagnose startup hangs or failures — particularly when the database host is unreachable, migrations are blocked on an advisory lock, or connection pool setup fails. ## Changes - Added `Info` log lines at each major stage of Postgres store initialization: target host/port/db/sslmode, migration pool open, migration execution, migration pool close, runtime pool open, pool tuning, plaintext row encryption, and final ready state. - Added `Error` log lines immediately before returning errors so failures are surfaced with context rather than silently propagated. - Log messages include actionable hints (e.g., "if this step hangs, the database host/port is likely unreachable", "may block on a cross-node advisory lock if another pod is migrating"). ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [x] Chore/CI ## Affected areas - [x] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs ## How to test Start the service pointed at a Postgres instance and observe logs during startup. Verify that each initialization stage emits the expected log lines. To test error paths, point the service at an unreachable host and confirm the error log is emitted before the process exits. ```sh go test ./framework/configstore/... ./framework/logstore/... ``` ## Breaking changes - [ ] Yes - [x] No ## Security considerations The connection info logged (host, port, db name, SSL mode) does not include credentials. Passwords are not logged. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [ ] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable

Summary
Adds structured, step-by-step info and error logging throughout the Postgres initialization path for both the config store and log store. This makes it significantly easier to diagnose startup hangs or failures — particularly when the database host is unreachable, migrations are blocked on an advisory lock, or connection pool setup fails.
Changes
Infolog lines at each major stage of Postgres store initialization: target host/port/db/sslmode, migration pool open, migration execution, migration pool close, runtime pool open, pool tuning, plaintext row encryption, and final ready state.Errorlog lines immediately before returning errors so failures are surfaced with context rather than silently propagated.Type of change
Affected areas
How to test
Start the service pointed at a Postgres instance and observe logs during startup. Verify that each initialization stage emits the expected log lines. To test error paths, point the service at an unreachable host and confirm the error log is emitted before the process exits.
go test ./framework/configstore/... ./framework/logstore/...Breaking changes
Security considerations
The connection info logged (host, port, db name, SSL mode) does not include credentials. Passwords are not logged.
Checklist
docs/contributing/README.mdand followed the guidelines