From a054c7d75274e7e3779848a8f84bc7536439db8f Mon Sep 17 00:00:00 2001 From: Alex Fedotyev <61838744+alex-fedotyev@users.noreply.github.com> Date: Tue, 24 Nov 2026 02:01:04 +0000 Subject: [PATCH 1/2] feat(app): show materialized view indicators on the trace search RED charts The Throughput, Errors and Duration tiles already read from a source's materialized views when one fits, but they hid the indicators dashboard tiles show, so there was no way to tell whether a tile was accelerated or why not. The tiles now use the dashboard defaults: the acceleration indicator with its explanation dialog, and the date-range indicator, which shows the range the view's rollups queried when it differs from the search range. --- .changeset/trace-search-mv-indicator.md | 5 ++++ .../Search/TraceRedMetricsChart.tsx | 2 -- .../__tests__/TraceRedMetricsChart.test.tsx | 11 ++++++++ .../e2e/features/materialized-views.spec.ts | 27 +++++++++++++++++++ 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 .changeset/trace-search-mv-indicator.md diff --git a/.changeset/trace-search-mv-indicator.md b/.changeset/trace-search-mv-indicator.md new file mode 100644 index 0000000000..9cc6bb3867 --- /dev/null +++ b/.changeset/trace-search-mv-indicator.md @@ -0,0 +1,5 @@ +--- +'@hyperdx/app': patch +--- + +feat: the trace search Throughput, Errors and Duration charts show the same materialized view indicators as dashboard tiles: whether a view accelerated the chart, and the time range it queried when the view's rollups widened it diff --git a/packages/app/src/components/Search/TraceRedMetricsChart.tsx b/packages/app/src/components/Search/TraceRedMetricsChart.tsx index 457c5f5855..3e569c9518 100644 --- a/packages/app/src/components/Search/TraceRedMetricsChart.tsx +++ b/packages/app/src/components/Search/TraceRedMetricsChart.tsx @@ -144,8 +144,6 @@ export function TraceRedMetricsChart({ sourceId: source.id, enabled: isReady, showDisplaySwitcher: false, - showMVOptimizationIndicator: false, - showDateRangeIndicator: false, queryKeyPrefix, onTimeRangeSelect, enableParallelQueries: true, diff --git a/packages/app/src/components/Search/__tests__/TraceRedMetricsChart.test.tsx b/packages/app/src/components/Search/__tests__/TraceRedMetricsChart.test.tsx index a2b1a3a838..e56062d8d6 100644 --- a/packages/app/src/components/Search/__tests__/TraceRedMetricsChart.test.tsx +++ b/packages/app/src/components/Search/__tests__/TraceRedMetricsChart.test.tsx @@ -142,4 +142,15 @@ describe('TraceRedMetricsChart', () => { ), ).toEqual(new Set(['Duration'])); }); + + it('shows the acceleration and date-range indicators on every RED tile', () => { + renderChart('red'); + + expect(mockTimeChartProps.length).toBeGreaterThan(0); + for (const props of mockTimeChartProps) { + // Left unset, DBTimeChart shows both, as on dashboard tiles. + expect(props.showMVOptimizationIndicator).not.toBe(false); + expect(props.showDateRangeIndicator).not.toBe(false); + } + }); }); diff --git a/packages/app/tests/e2e/features/materialized-views.spec.ts b/packages/app/tests/e2e/features/materialized-views.spec.ts index 4ea83825ae..55fc8e1588 100644 --- a/packages/app/tests/e2e/features/materialized-views.spec.ts +++ b/packages/app/tests/e2e/features/materialized-views.spec.ts @@ -145,6 +145,33 @@ test.describe( await expect(aggTable).toContainText('count'); }); + test('trace search RED charts show that the view accelerated them', async ({ + page, + }) => { + const searchPage = new SearchPage(page); + const mvComponent = new MaterializedViewComponent(page); + + await searchPage.goto(); + await searchPage.selectSource(DEFAULT_TRACES_MV_SOURCE_NAME); + // One-minute buckets, the view's granularity. + await searchPage.timePicker.selectRelativeTime('Last 1 hour'); + + // Throughput, Errors and Duration each read the view: counts by status, + // the error ratio, and avg/p95/p99 of Duration are all pre-aggregated. + const indicators = mvComponent.getIndicator(); + await expect(indicators).toHaveCount(3, { timeout: 15000 }); + for (const indicator of await indicators.all()) { + await expect(indicator).toHaveAttribute('data-mv-accelerated', 'true', { + timeout: 15000, + }); + } + + // The dialog explains which view served the chart. + await indicators.first().click(); + await expect(mvComponent.getModal()).toBeVisible({ timeout: 10000 }); + await expect(mvComponent.getModalItem(E2E_TRACES_MV_TABLE)).toBeVisible(); + }); + test( 'Configuring an MV with auto-population in the source form', { tag: '@sources' }, From f9acb06c9f3f298c0ae34ee20ab4e58acc924933 Mon Sep 17 00:00:00 2001 From: Alex Fedotyev <61838744+alex-fedotyev@users.noreply.github.com> Date: Tue, 24 Nov 2026 02:27:47 +0000 Subject: [PATCH 2/2] fix(app): fold the RED chart header controls into a menu on narrow tiles With the acceleration and date-range icons, the Errors header ran out of room below about 1100px: its title wrapped one letter per line, then disappeared. The RED charts now use the collapsed toolbar dashboard tiles use, which moves the header controls into a menu once a tile is 200px wide or less. --- .../Search/TraceRedMetricsChart.tsx | 103 +++++++++--------- 1 file changed, 54 insertions(+), 49 deletions(-) diff --git a/packages/app/src/components/Search/TraceRedMetricsChart.tsx b/packages/app/src/components/Search/TraceRedMetricsChart.tsx index 3e569c9518..d7a035b58e 100644 --- a/packages/app/src/components/Search/TraceRedMetricsChart.tsx +++ b/packages/app/src/components/Search/TraceRedMetricsChart.tsx @@ -8,6 +8,7 @@ import { Flex, SegmentedControl } from '@mantine/core'; import { IsolatedChartSyncProvider } from '@/chartSync'; import { ChartCard } from '@/components/charts/ChartCard'; +import { CollapsedToolbarProvider } from '@/components/charts/ChartContainer'; import DBHeatmapChart, { HEATMAP_DURATION_NUMBER_FORMAT, toHeatmapQuery, @@ -172,61 +173,65 @@ export function TraceRedMetricsChart({ return ( - - - {/* Throughput is the status-grouped count histogram this view - replaces, rendered from the same config under the results header's - query-key prefix so react-query runs a single shared scan, and it - keeps the per-status drill-down via onFocusSeries. */} - - - {errors != null && ( + {/* Narrow tiles fold their header controls into a menu, as + dashboard tiles do, so the titles keep their room. */} + + - {/* Remount on mode change: DBTimeChart seeds its display type - from the initial config when uncontrolled, so a key swap - re-seeds bars (volume) vs line (rate). */} + {/* Throughput is the status-grouped count histogram this view + replaces, rendered from the same config under the results header's + query-key prefix so react-query runs a single shared scan, and it + keeps the per-status drill-down via onFocusSeries. */} + + {errors != null && ( + + {/* Remount on mode change: DBTimeChart seeds its display type + from the initial config when uncontrolled, so a key swap + re-seeds bars (volume) vs line (rate). */} + + + )} + + {/* The duration series pin their colors on their select items (set + in durationConfig); applySelectColors opts this chart into them. */} + - )} - - {/* The duration series pin their colors on their select items (set - in durationConfig); applySelectColors opts this chart into them. */} - - - + + ); }