feat(app): show RED metrics on the trace search results view - #2826
feat(app): show RED metrics on the trace search results view#2826alex-fedotyev wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 48f1a5a The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThe PR replaces the trace-results histogram with synchronized throughput, error, and duration charts plus a duration heatmap option.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/app/src/DBSearchPage.tsx | Selects the RED or heatmap trace visualization while preserving the existing histogram for other sources. |
| packages/app/src/components/Search/TraceRedMetricsChart.tsx | Composes synchronized metric tiles, hides error-rate helper series, and reuses the dashboard heatmap renderer. |
| packages/app/src/components/Search/traceRedMetrics.ts | Builds throughput, error, and duration chart configurations while preserving raw-column aggregation. |
| packages/app/src/components/DBTimeChart.tsx | Forwards compact x-axis and capped y-axis presentation options to the shared chart. |
| packages/app/src/HDXMultiSeriesTimeChart.tsx | Adds inward-anchored compact time labels and bounded automatic y-axis scaling. |
| packages/app/src/components/Search/tests/traceRedMetrics.test.ts | Covers the RED aggregation builders, filtering behavior, helper series, and duration formatting. |
| packages/app/src/tests/HDXMultiSeriesTimeChart.test.ts | Covers compact tick anchoring and capped y-axis calculations. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Trace search configuration] --> B{Chart mode}
B -->|RED| C[Throughput: count spans]
B -->|RED| D[Errors: count and conditional count]
B -->|RED| E[Duration: avg, p95, p99]
D --> F[Post-aggregation error rate]
C --> G[Shared hover synchronization]
F --> G
E --> G
B -->|Heatmap| H[Duration heatmap]
Reviews (11): Last reviewed commit: "feat(app): show RED metrics on the trace..." | Re-trigger Greptile
E2E Test Results✅ All tests passed • 322 passed • 1 skipped • 1302s
Tests ran across 4 shards in parallel. |
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Review process: Full human review — logic, architecture, edge cases. Stats
|
575ea72 to
fc7e432
Compare
Deep Review✅ No critical issues found. This PR replaces the trace-search count histogram with RED metrics (Throughput / Errors / Duration) for trace sources that expose a duration column, adds a RED/Heatmap toggle, and introduces two small chart-axis primitives ( The one substantive prior-review concern — that the error-rate chart used 🟡 P2 -- recommended
🔵 P3 nitpicks (2)
Reviewers (2): previous-comments, orchestrator synthesis (correctness, performance, maintainability, testing). Testing gaps:
|
fc7e432 to
759003d
Compare
759003d to
ecb2726
Compare
ecb2726 to
a99b07b
Compare
a99b07b to
e974b8c
Compare
For a trace source in results mode, replace the single count histogram above the results with a Throughput / Errors / Duration trio: - Throughput counts spans (bars). Duration shows Avg / p95 / p99 over the raw Duration column, with the unit applied at display from the source precision. - Errors toggles between rate and volume. Rate is countIf/count as a percent line, capped at 100%. Volume groups error spans by status and renders them as bars, so clicking a bar filters the results to that status; this keeps the per-status drill-down the count histogram had. - The three charts are DBTimeCharts under a shared sync scope (synced hover cursor) and use the dashboard tile card header. A RED/Heatmap switch in the stats row flips to the same heatmap tile the dashboard renders, and resets to RED when the source changes. - Aggregations are over raw columns (count, countIf, quantile/avg) so materialized views can satisfy them; ratio and unit conversion happen at the display layer. Aggregation builders live in a pure, unit-tested module. - Adds an opt-in compactXAxisLabels (edge-anchor first/last x labels) and yAxisMaxDomain (cap the y-axis while auto-scaling below it) to the shared time chart, both covered by focused unit tests. Logs and session sources keep the existing histogram. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2d9774d to
48f1a5a
Compare
Summary
Trace search shows a single count histogram above the results. For trace sources in results mode, this replaces it with RED metrics:
countIf(error) / count(), rendered as a percent line) and volume (countIf(error), bars).Every aggregation is over a raw column (
count,countIf,quantile/avgof the duration expression), so AggregatingMergeTree materialized views can satisfy the queries; ratio and unit conversion happen at the display layer or in a post-aggregation column.The three charts are
DBTimeCharts under a shared sync scope, so hovering one shows a synced cursor on all three at the same timestamp, and each renders as a dashboard-tile card. A RED/Heatmap switch in the search stats row flips the area to the same duration heatmap tile the dashboard renders.Each chart is built from the same base config the histogram uses (in a small pure module,
traceRedMetrics.ts), so they honor the active WHERE filter and selected time range. Logs and session sources keep the existing histogram.This reuses existing building blocks (
DBTimeChart,SegmentedControl, the chart-sync context,DBHeatmapChart+toHeatmapChartConfig, and the tile card header); no new chart or control primitives.Screenshots
Verified in both light and dark themes.
Test plan
traceRedMetrics.test.ts); those plus the existingDBSearchPagesuites pass underjest.tsc --noEmitandeslintare clean.DBTimeChart.Notes
minorchangeset.