fix(intake): performance improvements for trace list - #1002
Conversation
Signed-off-by: Brian Newsom <brnewsom@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughNon-summary trace listing now retrieves page roots first, hydrates selected traces through page-scoped ClickHouse queries, reconciles missing hydrated rows, logs dropped references, and adjusts totals. Tests cover preview, detailed, empty-page, ordering, and query-shape behavior. ChangesTrace page hydration
Sequence Diagram(s)sequenceDiagram
participant ClickHouseTraceRepository
participant ClickHouseClient
participant PageRootQuery
ClickHouseTraceRepository->>ClickHouseClient: Execute page-root query
ClickHouseClient->>PageRootQuery: Select page trace roots
PageRootQuery-->>ClickHouseClient: Return page references
ClickHouseClient-->>ClickHouseTraceRepository: Return page rows
ClickHouseTraceRepository->>ClickHouseClient: Execute page-scoped hydration query
ClickHouseClient-->>ClickHouseTraceRepository: Return hydrated rows
ClickHouseTraceRepository->>ClickHouseTraceRepository: Reconcile order and dropped refs
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@services/intake/src/nmp/intake/repository/clickhouse/trace.py`:
- Around line 135-165: Reconcile hydration results with the page references in
the trace listing flow: after the `traces.list.hydrate` query, detect page refs
that were not returned because concurrent filtering or deletion excluded them,
and explicitly track or log those dropped refs rather than silently shrinking
the page. Keep `total_results` and pagination behavior consistent with the
chosen reconciliation policy.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 2fab7cf1-b5b9-4294-a510-d69eb6cb9940
📒 Files selected for processing (2)
services/intake/src/nmp/intake/repository/clickhouse/trace.pyservices/intake/tests/test_traces_clickhouse_repository.py
Signed-off-by: Brian Newsom <brnewsom@nvidia.com>
|
Use a two phase query to hydrate the trace list view instead of the current single query approach, which requires reading all input/output data across spans.
Summary by CodeRabbit
Bug Fixes
Tests