:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
refactor(tracing): rename TraceFlameChart to TraceWaterfallView (#62885)
Jon McCallum56e59e2094c0
diff --git a/products/tracing/frontend/TraceCompareFlame.tsx b/products/tracing/frontend/TraceCompareFlame.tsxindex 71d4dcb0f00b..ade21ef81f59 100644--- a/products/tracing/frontend/TraceCompareFlame.tsx+++ b/products/tracing/frontend/TraceCompareFlame.tsx@@ -9,7 +9,7 @@ import { humanFriendlyNumber } from 'lib/utils'import { SpanTreeNode } from '~/queries/schema/schema-general'-import { formatDuration } from './TraceFlameChart'+import { formatDuration } from './TraceWaterfallView'interface TreeNode {serviceName: stringdiff --git a/products/tracing/frontend/TraceCompareTable.tsx b/products/tracing/frontend/TraceCompareTable.tsxindex 3345f12a8ed0..ee712cd65825 100644--- a/products/tracing/frontend/TraceCompareTable.tsx+++ b/products/tracing/frontend/TraceCompareTable.tsx@@ -6,7 +6,7 @@ import { humanFriendlyNumber } from 'lib/utils'import { AggregatedSpanRow } from '~/queries/schema/schema-general'-import { formatDuration } from './TraceFlameChart'+import { formatDuration } from './TraceWaterfallView'interface CompareRow {service_name: stringdiff --git a/products/tracing/frontend/TraceFlameChart.tsx b/products/tracing/frontend/TraceWaterfallView.tsxsimilarity index 98%rename from products/tracing/frontend/TraceFlameChart.tsxrename to products/tracing/frontend/TraceWaterfallView.tsxindex 1be056cb22f1..70a0ec0579a8 100644--- a/products/tracing/frontend/TraceFlameChart.tsx+++ b/products/tracing/frontend/TraceWaterfallView.tsx@@ -12,7 +12,7 @@ import { Tooltip } from 'lib/lemon-ui/Tooltip'import { SPAN_KIND_LABELS, STATUS_CODE_LABELS } from './types'import type { Span } from './types'-interface TraceFlameChartProps {+interface TraceWaterfallViewProps {spans: Span[]}@@ -145,7 +145,7 @@ const LABEL_COLUMN_WIDTH_STORAGE_KEY = 'tracing-trace-label-width'const LABEL_SPLITTER_HIT_PX = 8const ROW_HEIGHT = 32// Cap the windowed list viewport; taller traces scroll inside it instead of growing the modal.-const MAX_FLAME_HEIGHT = 600+const MAX_WATERFALL_HEIGHT = 600// Rough extra room reserved when a span's detail panel is open, so a selection near the top of a// short trace doesn't pop an unexpected scrollbar.const SELECTED_DETAIL_RESERVE = 320@@ -284,7 +284,7 @@ function SpanDetailPanel({ span }: { span: Span }): JSX.Element {)}-interface FlameRowData {+interface WaterfallRowData {flatSpans: SpanNode[]traceStartUs: numbertraceDurationUs: number@@ -296,7 +296,7 @@ interface FlameRowData {dynamicRowHeight: ReturnType<typeof useDynamicRowHeight>}-function FlameRow({+function WaterfallRow({node,traceStartUs,traceDurationUs,@@ -305,7 +305,7 @@ function FlameRow({labelColumnWidth,selectedSpanId,onSelect,-}: Omit<FlameRowData, 'flatSpans' | 'dynamicRowHeight'> & { node: SpanNode }): JSX.Element {+}: Omit<WaterfallRowData, 'flatSpans' | 'dynamicRowHeight'> & { node: SpanNode }): JSX.Element {const { span } = nodeconst spanStartUs = parseTimestampUs(span.timestamp)const spanDurationUs = span.duration_nano / 1_000@@ -418,7 +418,7 @@ function FlameRow({)}-function FlameListRow({+function WaterfallListRow({ariaAttributes,index,style,@@ -435,7 +435,7 @@ function FlameListRow({ariaAttributes: { 'aria-posinset': number; 'aria-setsize': number; role: 'listitem' }index: numberstyle: CSSProperties-} & FlameRowData): JSX.Element {+} & WaterfallRowData): JSX.Element {const rowRef = useRef<HTMLDivElement>(null)const node = flatSpans[index]@@ -448,7 +448,7 @@ function FlameListRow({return (// eslint-disable-next-line react/forbid-dom-props<div {...ariaAttributes} ref={rowRef} style={style} data-index={index} data-row-key={node.span.uuid}>- <FlameRow+ <WaterfallRownode={node}traceStartUs={traceStartUs}traceDurationUs={traceDurationUs}@@ -462,7 +462,7 @@ function FlameListRow({)}-export function TraceFlameChart({ spans }: TraceFlameChartProps): JSX.Element {+export function TraceWaterfallView({ spans }: TraceWaterfallViewProps): JSX.Element {const [selectedSpanId, setSelectedSpanId] = useState<string | null>(null)const [cursorPct, setCursorPct] = useState<number | null>(null)const [labelColumnWidth, setLabelColumnWidth] = useState(@@ -681,18 +681,18 @@ export function TraceFlameChart({ spans }: TraceFlameChartProps): JSX.Element {<AutoSizerdisableHeightrenderProp={({ width }: SizeProps) => (- <List<FlameRowData>+ <List<WaterfallRowData>style={{height: Math.min(flatSpans.length * ROW_HEIGHT + (selectedSpanId ? SELECTED_DETAIL_RESERVE : 0),- MAX_FLAME_HEIGHT+ MAX_WATERFALL_HEIGHT),width,}}overscanCount={10}rowCount={flatSpans.length}rowHeight={dynamicRowHeight}- rowComponent={FlameListRow}+ rowComponent={WaterfallListRow}rowProps={{flatSpans,traceStartUs,diff --git a/products/tracing/frontend/TracingScene.tsx b/products/tracing/frontend/TracingScene.tsxindex cce5a573fdae..6b9eea93c189 100644--- a/products/tracing/frontend/TracingScene.tsx+++ b/products/tracing/frontend/TracingScene.tsx@@ -18,7 +18,7 @@ import { TracingSetupPrompt } from './components/SetupPrompt/SetupPrompt'import { VirtualizedSpanList } from './components/VirtualizedSpanList/VirtualizedSpanList'import { TraceCompareFlame } from './TraceCompareFlame'import { TraceCompareTable } from './TraceCompareTable'-import { TraceFlameChart } from './TraceFlameChart'+import { TraceWaterfallView } from './TraceWaterfallView'import { tracingDataLogic } from './tracingDataLogic'import { TracingFilterBar } from './TracingFilterBar'import { tracingFiltersLogic } from './tracingFiltersLogic'@@ -222,7 +222,7 @@ function TracingSceneContents(): JSX.Element {><div className="relative min-h-32">{isLoadingFullTrace && <SpinnerOverlay />}- <TraceFlameChart spans={modalSpans} />+ <TraceWaterfallView spans={modalSpans} /></div></LemonModal><LemonModaldiff --git a/products/tracing/frontend/components/VirtualizedSpanList/ExpandedSpanContent.tsx b/products/tracing/frontend/components/VirtualizedSpanList/ExpandedSpanContent.tsxindex 8dee4f575445..c6d34ab0f09e 100644--- a/products/tracing/frontend/components/VirtualizedSpanList/ExpandedSpanContent.tsx+++ b/products/tracing/frontend/components/VirtualizedSpanList/ExpandedSpanContent.tsx@@ -1,4 +1,4 @@-import { formatDuration } from '../../TraceFlameChart'+import { formatDuration } from '../../TraceWaterfallView'import { SPAN_KIND_LABELS, STATUS_CODE_LABELS } from '../../types'import type { Span } from '../../types'import { SpanAttributes } from './SpanAttributes'diff --git a/products/tracing/frontend/components/VirtualizedSpanList/VirtualizedSpanList.tsx b/products/tracing/frontend/components/VirtualizedSpanList/VirtualizedSpanList.tsxindex 8b987948265d..bc480029359b 100644--- a/products/tracing/frontend/components/VirtualizedSpanList/VirtualizedSpanList.tsx+++ b/products/tracing/frontend/components/VirtualizedSpanList/VirtualizedSpanList.tsx@@ -9,7 +9,7 @@ import { SizeProps } from 'lib/components/AutoSizer/AutoSizer'import { SortingIndicator } from 'lib/lemon-ui/LemonTable/sorting'import { cn } from 'lib/utils/css-classes'-import { formatDuration } from '../../TraceFlameChart'+import { formatDuration } from '../../TraceWaterfallView'import type { TracingOrderBy, TracingOrderDirection } from '../../tracingFiltersLogic'import { SPAN_KIND_LABELS, STATUS_CODE_LABELS } from '../../types'import type { Span } from '../../types'