Expose privacy-safe in-process answer coalescing metrics on deep health probe#754
Expose privacy-safe in-process answer coalescing metrics on deep health probe#754BigSimmo wants to merge 4 commits into
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
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 (8)
📝 WalkthroughWalkthroughThe change adds process-local answer coalescing metrics, records them in the RAG in-flight request path, exposes them only through authorized deep health probes, excludes them from readiness responses, and documents the new diagnostic block and capacity guidance. ChangesAnswer Coalescing Observability
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant AnswerRequest
participant RAG
participant Metrics
participant DeepHealthProbe
participant HealthResponse
AnswerRequest->>RAG: request answer
RAG->>Metrics: record origination or coalesced waiter
RAG->>Metrics: record origination completion
DeepHealthProbe->>HealthResponse: request authorized deep probe
HealthResponse->>Metrics: read coalescing snapshot
Metrics-->>HealthResponse: return counters and rate
HealthResponse-->>DeepHealthProbe: return coalescing diagnostic block
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
…e-production-readiness
…e-production-readiness
Pull request was closed
Motivation
Description
src/lib/observability/answer-coalescing-metrics.tsthat records originations, coalesced waiters, an active-origination gauge, and a derived coalescing rate.src/lib/rag.tsto increment the new counters for coalescible requests and to avoid counting cache-bypassing requests or emitting any request-specific content.src/lib/health-response.tsas an opt-incoalescingblock while keeping/api/health/readyfree of diagnostic counters viasrc/app/api/health/ready/route.ts.tests/answer-coalescing-metrics.test.ts, extendtests/health-route.test.tsto assert privacy/authorization behavior, and update docs (docs/observability-slos.md,docs/capacity-review.md) describing operator interpretation and recommended usage.Testing
git diff --cached --check) passed for the staged changes so the patch is syntactically clean.npm run verify:pr-local -- --dry-run) successfully produced the verification plan including the expected gates forcheck:runtime, lint/typecheck, tests and build; it did not execute hosted/provider checks (dry run only).npm run testfailed due to missingvitestruntime artifact and the environment provided Node v20 while the repo requires Node 24, andverify:cheap/verify:release:offlineblocked on a missingtsx/cliresolver; these are environmental, not code failures.Codex Task
Summary by CodeRabbit
New Features
Bug Fixes
Documentation