Instrument database pool roles - #7356
Draft
TheSentinel454 wants to merge 2 commits into
Draft
Conversation
Expose one closed physical Postgres pool-role vocabulary — writer,
reader, audit, and search — used only at pool construction and the
utilization-metrics boundary. Emit a fixed-cardinality role-labelled
contract (buzz_db_pool_connections{pool_role,state} plus
buzz_db_pool_configured{pool_role}) so all four roles are always present
and unconfigured optional pools report zero rather than disappearing.
The existing writer buzz_db_pool_* and reader buzz_db_read_pool_* gauges
are preserved unchanged for dashboard compatibility. Audit and search
keep cheap PgPool clones purely as statistics handles; service
ownership, pool capacities, timeouts, and query routing are unchanged,
and no aggregate deployment connection budget is enforced.
Document the new families in the Helm chart operator README and correct
the stale ARCHITECTURE.md claim that search indexing is an asynchronous
pipeline step — search_tsv is a generated column maintained on insert.
Signed-off-by: tornquist <tornquist@squareup.com>
Co-authored-by: Codex <noreply@openai.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
🔐 Codex Security Review
|
Signed-off-by: tornquist <tornquist@squareup.com> Co-authored-by: Codex <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Name the relay's four Postgres pool roles—writer, reader, audit, and search—and export one fixed-cardinality utilization metric contract for all of them. Existing writer and reader gauges remain unchanged.
Why
Audit and search already use separate pools, but they are missing from pool pressure telemetry. Operators cannot see all process-level connection demand before setting a deployment-wide connection budget.
How
A closed
DbPoolRolevocabulary now labelsbuzz_db_pool_connections{pool_role,state}andbuzz_db_pool_configured{pool_role}. The relay retains cheap pool clones for statistics only; ownership, capacities, timeouts, query routing, and failure behavior do not change. The docs also replace the stale async search-index description with the generated-column behavior used today.This simplifies four ad hoc observability states into one bounded model without adding a pool manager or changing service boundaries.
Risk
Low to moderate. This changes relay metrics and pool construction plumbing, but not SQL execution or routing. Legacy metric names remain available for current dashboards.
Testing
3f5468a0463bdfc5879bcdd3878fa06b42ca84c2: all 14 Rust test lanes passed; desktop Tauri checks passed.cargo test --workspace --all-targetswith repository-declared Postgres services.cargo clippy --workspace --all-targets -- -D warnings.cargo fmt --all -- --check.Bigger picture
Aggregate deployment budget enforcement remains deferred. This PR exposes the per-role facts that a later deployment-policy change can consume.
Generated with Claude Code