: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
feat(replay-vision): rearrange observations stats and cleanup (#73024)
Hayne Ryu7c6d708119f1
diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerConfigReadonly.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerConfigReadonly.tsxindex 473f53198f30..abcbfc543a73 100644--- a/products/replay_vision/frontend/replay_scanners/components/ScannerConfigReadonly.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerConfigReadonly.tsx@@ -397,13 +397,6 @@ export function ScannerConfigReadonly({ scanner }: { scanner: ReplayScanner }):<LabeledRow label="Total observations"><span className="tabular-nums">{observationStats.total.toLocaleString()}</span></LabeledRow>- <LabeledRow label="Success rate">- {observationStats.successRate != null ? (- <span className="tabular-nums">{observationStats.successRate}%</span>- ) : (- <span className="text-muted">—</span>- )}- </LabeledRow><LabeledRow label="Outcomes"><span className="text-sm">{observationStats.succeeded.toLocaleString()} succeeded ·{' '}diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerObservationsTable.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerObservationsTable.tsxindex 3707202c7708..214114c55afe 100644--- a/products/replay_vision/frontend/replay_scanners/components/ScannerObservationsTable.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerObservationsTable.tsx@@ -58,23 +58,6 @@ const OBSERVATION_DATE_OPTIONS: DateMappingOption[] = [// Chip color by how many versions behind the live scanner an observation ran: latest → oldest.const VERSION_TAG_TYPES: LemonTagType[] = ['success', 'warning', 'caution', 'danger', 'completion']-function Metric({- label,- value,- valueClass,-}: {- label: string- value: number | string- valueClass?: string-}): JSX.Element {- return (- <div className="text-center">- <div className={`font-semibold text-lg ${valueClass ?? ''}`}>{value}</div>- <div className="text-muted">{label}</div>- </div>- )-}-export function versionTag(obsVersion: number | null | undefined,currentVersion: number | null | undefined@@ -251,6 +234,13 @@ export function ScannerObservationsTable({ scannerId }: { scannerId: string }):<div className="space-y-2"><div className="flex items-center gap-3"><h3 className="font-semibold text-base m-0">Observation history</h3>+ <span className="text-muted text-sm whitespace-nowrap">+ {observationStats.total.toLocaleString()} total ·{' '}+ <span className={observationStats.failed > 0 ? 'text-danger' : undefined}>+ {observationStats.failed.toLocaleString()} failed+ </span>{' '}+ · {observationStats.inFlight.toLocaleString()} in flight+ </span><div className="ml-auto flex items-center gap-3"><div className="flex items-center gap-2">{(observationStats.total > 0 || hasActiveObservationFilters) && (@@ -328,22 +318,6 @@ export function ScannerObservationsTable({ scannerId }: { scannerId: string }):</LemonButton></Tooltip></div>- {/* Always rendered (0 / N/A when empty) so a zero-match filter doesn't drop the metrics and shift the controls. */}- <div className="flex gap-4 text-sm">- <Metric label="Total" value={observationStats.total} />- <Metric- label="Success rate"- value={observationStats.successRate !== null ? `${observationStats.successRate}%` : 'N/A'}- valueClass={observationStats.successRate !== null ? 'text-success' : undefined}- />- <Metric- label="Failed"- value={observationStats.failed}- valueClass={observationStats.failed > 0 ? 'text-danger' : undefined}- />- <Metric label="Ineligible" value={observationStats.ineligible} />- <Metric label="In flight" value={observationStats.inFlight} />- </div></div></div><LemonTablediff --git a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.tsindex 6dcd4e11b54d..b819b33f254a 100644--- a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts+++ b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts@@ -259,7 +259,6 @@ export interface replayScannerLogicValues {ineligible: numberinFlight: numbersucceeded: number- successRate: number | nulltotal: number}observationStatsApi: ObservationStatsApi | null@@ -601,7 +600,6 @@ export interface replayScannerLogicMeta {ineligible: numberinFlight: numbersucceeded: number- successRate: number | nulltotal: number}monitorStats: (observationStatsApi: ObservationStatsApi | null) => {@@ -1201,10 +1199,9 @@ export const replayScannerLogic = kea<replayScannerLogicType>([failed: numberineligible: numberinFlight: number- successRate: number | null} => {if (!stats) {- return { total: 0, succeeded: 0, failed: 0, ineligible: 0, inFlight: 0, successRate: null }+ return { total: 0, succeeded: 0, failed: 0, ineligible: 0, inFlight: 0 }}const c = stats.status_countsreturn {@@ -1213,7 +1210,6 @@ export const replayScannerLogic = kea<replayScannerLogicType>([failed: c.failed,ineligible: c.ineligible,inFlight: c.in_flight,- successRate: c.success_rate,}},],