Skip to content

: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.

feat(web-analytics): show when precomputed tiles were computed (#118646)

Lucas Ricoycc29f895b84f
diff --git a/frontend/src/lib/components/PreAggregatedBadge/PreAggregatedBadge.tsx b/frontend/src/lib/components/PreAggregatedBadge/PreAggregatedBadge.tsx
index fa90f225104c..e327c0ab6011 100644
--- a/frontend/src/lib/components/PreAggregatedBadge/PreAggregatedBadge.tsx
+++ b/frontend/src/lib/components/PreAggregatedBadge/PreAggregatedBadge.tsx
@@ -4,9 +4,11 @@ import { useValues } from 'kea'
import { IconBolt, IconDatabaseBolt } from '@posthog/icons'
import { FEATURE_FLAGS } from 'lib/constants'
+import { dayjs } from 'lib/dayjs'
import { Link } from 'lib/lemon-ui/Link'
import { Tooltip } from 'lib/lemon-ui/Tooltip'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
+import { humanFriendlyDetailedTime } from 'lib/utils/datetime'
export type PreAggregatedBadgeVariant = 'preagg' | 'precomputed'
export type PreAggregatedBadgePosition = 'top-right' | 'bottom-right'
@@ -20,6 +22,10 @@ interface PreAggregatedBadgeProps {
// Optional opt-out wired by the host (the web analytics page). Keeps this component scene-agnostic:
// when omitted, the tooltip just drops the "always query live data" shortcut.
onDisable?: () => void
+ // ISO timestamp of the oldest precomputed window that the response used.
+ computedAt?: string
+ // The response came from expired precomputed data while a background refresh runs.
+ stale?: boolean
}
const POSITION_CLASS: Record<PreAggregatedBadgePosition, string> = {
@@ -35,11 +41,24 @@ function PreAggregatedTooltip(): JSX.Element {
)
}
-function PrecomputedTooltip({ onDisable }: { onDisable?: () => void }): JSX.Element {
+function PrecomputedTooltip({
+ onDisable,
+ computedAt,
+ stale,
+}: Pick<PreAggregatedBadgeProps, 'onDisable' | 'computedAt' | 'stale'>): JSX.Element {
return (
<div className="flex flex-col gap-1 max-w-xs">
<span>Loaded from a pre-computed state instead of running a live query against all events.</span>
<span>It should be very close to live data, but isn't guaranteed to be exact.</span>
+ {computedAt && (
+ <span>
+ <span>Data as of </span>
+ <span translate="no">
+ {`${dayjs(computedAt).fromNow()} (${humanFriendlyDetailedTime(computedAt, 'MMMM DD, YYYY', 'h:mm A', { timestampStyle: 'absolute' })})`}
+ </span>
+ </span>
+ )}
+ {stale && <span>This pre-computed data has expired and may not include recent events.</span>}
<span>
<Link to={QUERY_ENGINE_DOCS_URL}>Learn more</Link>
{onDisable && (
@@ -57,6 +76,8 @@ export function PreAggregatedBadge({
variant = 'preagg',
position = 'top-right',
onDisable,
+ computedAt,
+ stale,
}: PreAggregatedBadgeProps = {}): JSX.Element | null {
const { featureFlags } = useValues(featureFlagLogic)
const isPrecomputed = variant === 'precomputed'
@@ -67,13 +88,24 @@ export function PreAggregatedBadge({
return null
}
+ const showFreshness = !!featureFlags[FEATURE_FLAGS.WEB_ANALYTICS_PRECOMPUTED_AT]
const Icon = isPrecomputed ? IconDatabaseBolt : IconBolt
const iconClassName = isPrecomputed ? 'text-muted w-4 h-4' : 'text-warning w-4 h-4'
return (
<Tooltip
interactive
- title={isPrecomputed ? <PrecomputedTooltip onDisable={onDisable} /> : <PreAggregatedTooltip />}
+ title={
+ isPrecomputed ? (
+ <PrecomputedTooltip
+ onDisable={onDisable}
+ computedAt={showFreshness ? computedAt : undefined}
+ stale={showFreshness && stale}
+ />
+ ) : (
+ <PreAggregatedTooltip />
+ )
+ }
>
<div className={clsx('absolute z-10', POSITION_CLASS[position])}>
<Icon className={iconClassName} />
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index cecd47501ba9..7b34db77069c 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -588,6 +588,7 @@ export const FEATURE_FLAGS = {
WEB_ANALYTICS_MARKETING_CROSS_SELL_V2: 'web-analytics-marketing-cross-sell-v2', // owner: @jordanm-posthog #team-web-analytics multivariate=control,test
WEB_ANALYTICS_PAGE_PERFORMANCE: 'web-analytics-page-performance', // owner: @jordanm-posthog #team-web-analytics
WEB_ANALYTICS_PRECOMPUTE_TOGGLE: 'web-analytics-precompute-toggle', // owner: @lricoy #team-web-analytics
+ WEB_ANALYTICS_PRECOMPUTED_AT: 'web-analytics-precomputed-at', // owner: @lricoy #team-web-analytics
WEB_ANALYTICS_RECAP: 'web-analytics-recap', // owner: @jordanm-posthog #team-web-analytics
WEB_ANALYTICS_REGIONS_MAP: 'web-analytics-regions-map', // owner: @jordanm-posthog #team-web-analytics
WEB_ANALYTICS_REMOVE_REPLAY_TILE: 'web-analytics-remove-replay-tile', // owner: @lricoy #team-web-analytics multivariate=control,test
diff --git a/frontend/src/queries/nodes/DataTable/DataTable.tsx b/frontend/src/queries/nodes/DataTable/DataTable.tsx
index d6188d537f4c..72787a399e58 100644
--- a/frontend/src/queries/nodes/DataTable/DataTable.tsx
+++ b/frontend/src/queries/nodes/DataTable/DataTable.tsx
@@ -210,6 +210,8 @@ export function DataTable({
// Lazy precompute can be on without the v2 pre-agg flag, so it surfaces a
// badge regardless of `canUseWebAnalyticsPreAggregatedTables`.
const usedWebAnalyticsLazyPrecompute = preComputeStrategy === WebAnalyticsPreComputeStrategy.LazyPrecompute
+ const preComputedAt = response && 'preComputedAt' in response ? response.preComputedAt : undefined
+ const preComputeStale = response && 'preComputeStale' in response ? response.preComputeStale : undefined
const dataTableLogicProps: DataTableLogicProps = {
query,
@@ -1084,6 +1086,8 @@ export function DataTable({
<PreAggregatedBadge
variant="precomputed"
onDisable={context?.onDisableWebAnalyticsPrecompute}
+ computedAt={preComputedAt}
+ stale={preComputeStale}
/>
) : usedWebAnalyticsPreAggregatedTables ? (
<PreAggregatedBadge variant="preagg" />
diff --git a/frontend/src/queries/nodes/OverviewGrid/OverviewMetricCardGrid.tsx b/frontend/src/queries/nodes/OverviewGrid/OverviewMetricCardGrid.tsx
index d713ba9284b4..aa25d3710d98 100644
--- a/frontend/src/queries/nodes/OverviewGrid/OverviewMetricCardGrid.tsx
+++ b/frontend/src/queries/nodes/OverviewGrid/OverviewMetricCardGrid.tsx
@@ -29,6 +29,8 @@ interface OverviewMetricCardGridProps {
sparklineTheme?: ChartTheme
samplingRate?: SamplingRate
preComputeStrategy?: WebAnalyticsPreComputeStrategy
+ preComputedAt?: string
+ preComputeStale?: boolean
onDisablePrecompute?: () => void
labelFromKey: (key: string) => React.ReactNode
}
@@ -43,6 +45,8 @@ export function OverviewMetricCardGrid({
sparklineTheme,
samplingRate,
preComputeStrategy,
+ preComputedAt,
+ preComputeStale,
onDisablePrecompute,
labelFromKey,
}: OverviewMetricCardGridProps): JSX.Element {
@@ -64,6 +68,8 @@ export function OverviewMetricCardGrid({
emptyMessage={emptyMessage}
stretch={layout === 'contents'}
preComputeStrategy={preComputeStrategy}
+ preComputedAt={preComputedAt}
+ preComputeStale={preComputeStale}
onDisablePrecompute={onDisablePrecompute}
labelFromKey={labelFromKey}
/>
@@ -80,6 +86,8 @@ function MetricCardCell({
emptyMessage,
stretch,
preComputeStrategy,
+ preComputedAt,
+ preComputeStale,
onDisablePrecompute,
labelFromKey,
}: {
@@ -88,6 +96,8 @@ function MetricCardCell({
emptyMessage?: React.ReactNode
stretch?: boolean
preComputeStrategy?: WebAnalyticsPreComputeStrategy
+ preComputedAt?: string
+ preComputeStale?: boolean
onDisablePrecompute?: () => void
labelFromKey: (key: string) => React.ReactNode
}): JSX.Element {
@@ -121,7 +131,13 @@ function MetricCardCell({
sparklineClassName="mt-3"
adornment={
preComputeStrategy === WebAnalyticsPreComputeStrategy.LazyPrecompute ? (
- <PreAggregatedBadge variant="precomputed" position="bottom-right" onDisable={onDisablePrecompute} />
+ <PreAggregatedBadge
+ variant="precomputed"
+ position="bottom-right"
+ onDisable={onDisablePrecompute}
+ computedAt={preComputedAt}
+ stale={preComputeStale}
+ />
) : preComputeStrategy === WebAnalyticsPreComputeStrategy.PreAggregated ? (
<PreAggregatedBadge variant="preagg" position="bottom-right" />
) : undefined
diff --git a/frontend/src/queries/nodes/WebOverview/WebOverview.tsx b/frontend/src/queries/nodes/WebOverview/WebOverview.tsx
index 1ffa6f075102..dd7bf80a89ab 100644
--- a/frontend/src/queries/nodes/WebOverview/WebOverview.tsx
+++ b/frontend/src/queries/nodes/WebOverview/WebOverview.tsx
@@ -73,6 +73,8 @@ export function WebOverview(props: {
numSkeletons={numSkeletons}
samplingRate={samplingRate}
preComputeStrategy={preComputeStrategy}
+ preComputedAt={webOverviewQueryResponse?.preComputedAt}
+ preComputeStale={webOverviewQueryResponse?.preComputeStale}
onDisablePrecompute={props.context.onDisableWebAnalyticsPrecompute}
labelFromKey={labelFromKey}
/>
diff --git a/frontend/src/queries/nodes/WebVitals/WebVitalsPathBreakdown.tsx b/frontend/src/queries/nodes/WebVitals/WebVitalsPathBreakdown.tsx
index 8f352841e4e3..cf54ded02890 100644
--- a/frontend/src/queries/nodes/WebVitals/WebVitalsPathBreakdown.tsx
+++ b/frontend/src/queries/nodes/WebVitals/WebVitalsPathBreakdown.tsx
@@ -60,7 +60,12 @@ export function WebVitalsPathBreakdown(props: {
return (
<div className="relative border rounded bg-surface-primary grid grid-cols-1 md:grid-cols-3 divide-y md:divide-y-0 md:divide-x min-h-60 h-full">
{webVitalsQueryResponse?.preComputeStrategy === WebAnalyticsPreComputeStrategy.LazyPrecompute && (
- <PreAggregatedBadge variant="precomputed" onDisable={props.context.onDisableWebAnalyticsPrecompute} />
+ <PreAggregatedBadge
+ variant="precomputed"
+ onDisable={props.context.onDisableWebAnalyticsPrecompute}
+ computedAt={webVitalsQueryResponse.preComputedAt}
+ stale={webVitalsQueryResponse.preComputeStale}
+ />
)}
<div className="p-4">
<Header band="good" label="Good" />
diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json
index 2b8fbede6766..9d5b8eb3767c 100644
--- a/frontend/src/queries/schema.json
+++ b/frontend/src/queries/schema.json
@@ -16470,9 +16470,17 @@
"description": "Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible.",
"type": "string"
},
+ "preComputeStale": {
+ "description": "Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline.",
+ "type": "boolean"
+ },
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_metadata": {
"type": "object"
},
@@ -16702,9 +16710,17 @@
"description": "Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible.",
"type": "string"
},
+ "preComputeStale": {
+ "description": "Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline.",
+ "type": "boolean"
+ },
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_metadata": {
"type": "object"
},
@@ -16949,6 +16965,10 @@
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_metadata": {
"type": "object"
},
@@ -17062,9 +17082,17 @@
"description": "Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible.",
"type": "string"
},
+ "preComputeStale": {
+ "description": "Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline.",
+ "type": "boolean"
+ },
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_metadata": {
"type": "object"
},
@@ -19197,9 +19225,17 @@
"description": "Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible.",
"type": "string"
},
+ "preComputeStale": {
+ "description": "Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline.",
+ "type": "boolean"
+ },
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_status": {
"$ref": "#/definitions/QueryStatus",
"description": "Query status indicates whether next to the provided data, a query is still running."
@@ -19292,6 +19328,10 @@
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_status": {
"$ref": "#/definitions/QueryStatus",
"description": "Query status indicates whether next to the provided data, a query is still running."
@@ -19542,9 +19582,17 @@
"description": "Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible.",
"type": "string"
},
+ "preComputeStale": {
+ "description": "Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline.",
+ "type": "boolean"
+ },
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_status": {
"$ref": "#/definitions/QueryStatus",
"description": "Query status indicates whether next to the provided data, a query is still running."
@@ -19619,9 +19667,17 @@
"description": "Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible.",
"type": "string"
},
+ "preComputeStale": {
+ "description": "Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline.",
+ "type": "boolean"
+ },
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_status": {
"$ref": "#/definitions/QueryStatus",
"description": "Query status indicates whether next to the provided data, a query is still running."
@@ -43271,9 +43327,17 @@
"description": "Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible.",
"type": "string"
},
+ "preComputeStale": {
+ "description": "Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline.",
+ "type": "boolean"
+ },
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_status": {
"$ref": "#/definitions/QueryStatus",
"description": "Query status indicates whether next to the provided data, a query is still running."
@@ -43366,6 +43430,10 @@
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_status": {
"$ref": "#/definitions/QueryStatus",
"description": "Query status indicates whether next to the provided data, a query is still running."
@@ -43696,9 +43764,17 @@
"description": "Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible.",
"type": "string"
},
+ "preComputeStale": {
+ "description": "Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline.",
+ "type": "boolean"
+ },
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_status": {
"$ref": "#/definitions/QueryStatus",
"description": "Query status indicates whether next to the provided data, a query is still running."
@@ -43773,9 +43849,17 @@
"description": "Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible.",
"type": "string"
},
+ "preComputeStale": {
+ "description": "Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline.",
+ "type": "boolean"
+ },
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_status": {
"$ref": "#/definitions/QueryStatus",
"description": "Query status indicates whether next to the provided data, a query is still running."
@@ -44972,9 +45056,17 @@
"description": "Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible.",
"type": "string"
},
+ "preComputeStale": {
+ "description": "Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline.",
+ "type": "boolean"
+ },
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_status": {
"$ref": "#/definitions/QueryStatus",
"description": "Query status indicates whether next to the provided data, a query is still running."
@@ -45067,6 +45159,10 @@
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_status": {
"$ref": "#/definitions/QueryStatus",
"description": "Query status indicates whether next to the provided data, a query is still running."
@@ -45317,9 +45413,17 @@
"description": "Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible.",
"type": "string"
},
+ "preComputeStale": {
+ "description": "Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline.",
+ "type": "boolean"
+ },
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_status": {
"$ref": "#/definitions/QueryStatus",
"description": "Query status indicates whether next to the provided data, a query is still running."
@@ -45394,9 +45498,17 @@
"description": "Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible.",
"type": "string"
},
+ "preComputeStale": {
+ "description": "Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline.",
+ "type": "boolean"
+ },
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_status": {
"$ref": "#/definitions/QueryStatus",
"description": "Query status indicates whether next to the provided data, a query is still running."
@@ -57682,9 +57794,17 @@
"description": "Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible.",
"type": "string"
},
+ "preComputeStale": {
+ "description": "Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline.",
+ "type": "boolean"
+ },
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_status": {
"$ref": "#/definitions/QueryStatus",
"description": "Query status indicates whether next to the provided data, a query is still running."
@@ -58080,9 +58200,17 @@
"description": "Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible.",
"type": "string"
},
+ "preComputeStale": {
+ "description": "Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline.",
+ "type": "boolean"
+ },
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_status": {
"$ref": "#/definitions/QueryStatus",
"description": "Query status indicates whether next to the provided data, a query is still running."
@@ -58501,6 +58629,10 @@
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_status": {
"$ref": "#/definitions/QueryStatus",
"description": "Query status indicates whether next to the provided data, a query is still running."
@@ -58724,9 +58856,17 @@
"description": "Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible.",
"type": "string"
},
+ "preComputeStale": {
+ "description": "Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline.",
+ "type": "boolean"
+ },
"preComputeStrategy": {
"$ref": "#/definitions/WebAnalyticsPreComputeStrategy"
},
+ "preComputedAt": {
+ "description": "When the oldest precomputed window this response used was computed. Unset for live responses.",
+ "type": "string"
+ },
"query_status": {
"$ref": "#/definitions/QueryStatus",
"description": "Query status indicates whether next to the provided data, a query is still running."
diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.ts
index 27906525ae17..4127f8ec5599 100644
--- a/frontend/src/queries/schema/schema-general.ts
+++ b/frontend/src/queries/schema/schema-general.ts
@@ -3538,6 +3538,10 @@ export interface WebOverviewQueryResponse extends AnalyticsQueryResponseBase {
preComputeStrategy?: WebAnalyticsPreComputeStrategy
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string
}
export type CachedWebOverviewQueryResponse = CachedQueryResponse<WebOverviewQueryResponse>
@@ -4171,6 +4175,8 @@ export interface WebStatsTableQueryResponse extends AnalyticsQueryResponseBase {
preComputeStale?: boolean
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string
}
export type CachedWebStatsTableQueryResponse = CachedQueryResponse<WebStatsTableQueryResponse>
@@ -4274,6 +4280,10 @@ export interface WebGoalsQueryResponse extends AnalyticsQueryResponseBase {
preComputeStrategy?: WebAnalyticsPreComputeStrategy
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string
}
export type CachedWebGoalsQueryResponse = CachedQueryResponse<WebGoalsQueryResponse>
@@ -4325,6 +4335,10 @@ export interface WebVitalsPathBreakdownQueryResponse extends AnalyticsQueryRespo
preComputeStrategy?: WebAnalyticsPreComputeStrategy
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string
}
export type CachedWebVitalsPathBreakdownQueryResponse = CachedQueryResponse<WebVitalsPathBreakdownQueryResponse>
diff --git a/posthog/schema.py b/posthog/schema.py
index 4819666dde40..a3fbc140ca41 100644
--- a/posthog/schema.py
+++ b/posthog/schema.py
@@ -9644,7 +9644,18 @@ class WebGoalsQueryResponse(BaseModel):
" refused it. Unset when the query was eligible."
),
)
+ preComputeStale: bool | None = Field(
+ default=None,
+ description=(
+ "Whether a lazy-precompute read was served from expired-within-grace"
+ " (stale) jobs instead of recomputing inline."
+ ),
+ )
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_status: QueryStatus | None = Field(
default=None,
description=("Query status indicates whether next to the provided data, a query is still running."),
@@ -9752,7 +9763,18 @@ class WebOverviewQueryResponse(BaseModel):
" refused it. Unset when the query was eligible."
),
)
+ preComputeStale: bool | None = Field(
+ default=None,
+ description=(
+ "Whether a lazy-precompute read was served from expired-within-grace"
+ " (stale) jobs instead of recomputing inline."
+ ),
+ )
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_status: QueryStatus | None = Field(
default=None,
description=("Query status indicates whether next to the provided data, a query is still running."),
@@ -9870,6 +9892,10 @@ class WebStatsTableQueryResponse(BaseModel):
),
)
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_status: QueryStatus | None = Field(
default=None,
description=("Query status indicates whether next to the provided data, a query is still running."),
@@ -16401,7 +16427,18 @@ class CachedWebGoalsQueryResponse(BaseModel):
" refused it. Unset when the query was eligible."
),
)
+ preComputeStale: bool | None = Field(
+ default=None,
+ description=(
+ "Whether a lazy-precompute read was served from expired-within-grace"
+ " (stale) jobs instead of recomputing inline."
+ ),
+ )
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_metadata: dict[str, Any] | None = None
query_scan: QueryScanSummary | None = Field(
default=None,
@@ -16539,7 +16576,18 @@ class CachedWebOverviewQueryResponse(BaseModel):
" refused it. Unset when the query was eligible."
),
)
+ preComputeStale: bool | None = Field(
+ default=None,
+ description=(
+ "Whether a lazy-precompute read was served from expired-within-grace"
+ " (stale) jobs instead of recomputing inline."
+ ),
+ )
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_metadata: dict[str, Any] | None = None
query_scan: QueryScanSummary | None = Field(
default=None,
@@ -16687,6 +16735,10 @@ class CachedWebStatsTableQueryResponse(BaseModel):
),
)
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_metadata: dict[str, Any] | None = None
query_scan: QueryScanSummary | None = Field(
default=None,
@@ -16758,7 +16810,18 @@ class CachedWebVitalsPathBreakdownQueryResponse(BaseModel):
" refused it. Unset when the query was eligible."
),
)
+ preComputeStale: bool | None = Field(
+ default=None,
+ description=(
+ "Whether a lazy-precompute read was served from expired-within-grace"
+ " (stale) jobs instead of recomputing inline."
+ ),
+ )
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_metadata: dict[str, Any] | None = None
query_scan: QueryScanSummary | None = Field(
default=None,
@@ -17104,7 +17167,18 @@ class Response4(BaseModel):
" refused it. Unset when the query was eligible."
),
)
+ preComputeStale: bool | None = Field(
+ default=None,
+ description=(
+ "Whether a lazy-precompute read was served from expired-within-grace"
+ " (stale) jobs instead of recomputing inline."
+ ),
+ )
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_status: QueryStatus | None = Field(
default=None,
description=("Query status indicates whether next to the provided data, a query is still running."),
@@ -17172,6 +17246,10 @@ class Response5(BaseModel):
),
)
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_status: QueryStatus | None = Field(
default=None,
description=("Query status indicates whether next to the provided data, a query is still running."),
@@ -17337,7 +17415,18 @@ class Response8(BaseModel):
" refused it. Unset when the query was eligible."
),
)
+ preComputeStale: bool | None = Field(
+ default=None,
+ description=(
+ "Whether a lazy-precompute read was served from expired-within-grace"
+ " (stale) jobs instead of recomputing inline."
+ ),
+ )
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_status: QueryStatus | None = Field(
default=None,
description=("Query status indicates whether next to the provided data, a query is still running."),
@@ -17394,7 +17483,18 @@ class Response9(BaseModel):
" refused it. Unset when the query was eligible."
),
)
+ preComputeStale: bool | None = Field(
+ default=None,
+ description=(
+ "Whether a lazy-precompute read was served from expired-within-grace"
+ " (stale) jobs instead of recomputing inline."
+ ),
+ )
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_status: QueryStatus | None = Field(
default=None,
description=("Query status indicates whether next to the provided data, a query is still running."),
@@ -21545,7 +21645,18 @@ class QueryResponseAlternative21(BaseModel):
" refused it. Unset when the query was eligible."
),
)
+ preComputeStale: bool | None = Field(
+ default=None,
+ description=(
+ "Whether a lazy-precompute read was served from expired-within-grace"
+ " (stale) jobs instead of recomputing inline."
+ ),
+ )
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_status: QueryStatus | None = Field(
default=None,
description=("Query status indicates whether next to the provided data, a query is still running."),
@@ -21613,6 +21724,10 @@ class QueryResponseAlternative22(BaseModel):
),
)
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_status: QueryStatus | None = Field(
default=None,
description=("Query status indicates whether next to the provided data, a query is still running."),
@@ -21778,7 +21893,18 @@ class QueryResponseAlternative26(BaseModel):
" refused it. Unset when the query was eligible."
),
)
+ preComputeStale: bool | None = Field(
+ default=None,
+ description=(
+ "Whether a lazy-precompute read was served from expired-within-grace"
+ " (stale) jobs instead of recomputing inline."
+ ),
+ )
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_status: QueryStatus | None = Field(
default=None,
description=("Query status indicates whether next to the provided data, a query is still running."),
@@ -21835,7 +21961,18 @@ class QueryResponseAlternative27(BaseModel):
" refused it. Unset when the query was eligible."
),
)
+ preComputeStale: bool | None = Field(
+ default=None,
+ description=(
+ "Whether a lazy-precompute read was served from expired-within-grace"
+ " (stale) jobs instead of recomputing inline."
+ ),
+ )
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_status: QueryStatus | None = Field(
default=None,
description=("Query status indicates whether next to the provided data, a query is still running."),
@@ -22530,7 +22667,18 @@ class QueryResponseAlternative41(BaseModel):
" refused it. Unset when the query was eligible."
),
)
+ preComputeStale: bool | None = Field(
+ default=None,
+ description=(
+ "Whether a lazy-precompute read was served from expired-within-grace"
+ " (stale) jobs instead of recomputing inline."
+ ),
+ )
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_status: QueryStatus | None = Field(
default=None,
description=("Query status indicates whether next to the provided data, a query is still running."),
@@ -22598,6 +22746,10 @@ class QueryResponseAlternative42(BaseModel):
),
)
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_status: QueryStatus | None = Field(
default=None,
description=("Query status indicates whether next to the provided data, a query is still running."),
@@ -22763,7 +22915,18 @@ class QueryResponseAlternative45(BaseModel):
" refused it. Unset when the query was eligible."
),
)
+ preComputeStale: bool | None = Field(
+ default=None,
+ description=(
+ "Whether a lazy-precompute read was served from expired-within-grace"
+ " (stale) jobs instead of recomputing inline."
+ ),
+ )
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_status: QueryStatus | None = Field(
default=None,
description=("Query status indicates whether next to the provided data, a query is still running."),
@@ -22820,7 +22983,18 @@ class QueryResponseAlternative46(BaseModel):
" refused it. Unset when the query was eligible."
),
)
+ preComputeStale: bool | None = Field(
+ default=None,
+ description=(
+ "Whether a lazy-precompute read was served from expired-within-grace"
+ " (stale) jobs instead of recomputing inline."
+ ),
+ )
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_status: QueryStatus | None = Field(
default=None,
description=("Query status indicates whether next to the provided data, a query is still running."),
@@ -26335,7 +26509,18 @@ class WebVitalsPathBreakdownQueryResponse(BaseModel):
" refused it. Unset when the query was eligible."
),
)
+ preComputeStale: bool | None = Field(
+ default=None,
+ description=(
+ "Whether a lazy-precompute read was served from expired-within-grace"
+ " (stale) jobs instead of recomputing inline."
+ ),
+ )
preComputeStrategy: WebAnalyticsPreComputeStrategy | None = None
+ preComputedAt: str | None = Field(
+ default=None,
+ description=("When the oldest precomputed window this response used was computed. Unset for live responses."),
+ )
query_status: QueryStatus | None = Field(
default=None,
description=("Query status indicates whether next to the provided data, a query is still running."),
diff --git a/products/dashboards/frontend/generated/api.schemas.ts b/products/dashboards/frontend/generated/api.schemas.ts
index cb09743b11e5..7ebb09b2d71a 100644
--- a/products/dashboards/frontend/generated/api.schemas.ts
+++ b/products/dashboards/frontend/generated/api.schemas.ts
@@ -4609,6 +4609,8 @@ export interface WebStatsTableQueryResponseApi {
/** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -4703,7 +4705,11 @@ export interface WebOverviewQueryResponseApi {
modifiers?: HogQLQueryModifiersApi | null
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -5059,7 +5065,11 @@ export interface Response4Api {
modifiers?: HogQLQueryModifiersApi | null
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -5092,6 +5102,8 @@ export interface Response5Api {
/** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -5177,7 +5189,11 @@ export interface Response8Api {
offset?: number | null
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -5215,7 +5231,11 @@ export interface Response9Api {
modifiers?: HogQLQueryModifiersApi | null
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -7121,7 +7141,11 @@ export interface WebGoalsQueryResponseApi {
offset?: number | null
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -7244,7 +7268,11 @@ export interface WebVitalsPathBreakdownQueryResponseApi {
modifiers?: HogQLQueryModifiersApi | null
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
diff --git a/products/desktop/packages/api-client/src/generated.ts b/products/desktop/packages/api-client/src/generated.ts
index 6020eb2d9ff5..689cdabe9978 100644
--- a/products/desktop/packages/api-client/src/generated.ts
+++ b/products/desktop/packages/api-client/src/generated.ts
@@ -3525,6 +3525,7 @@ export namespace Schemas {
preComputeStrategy?:
| (WebAnalyticsPreComputeStrategy | null)
| undefined;
+ preComputedAt?: (string | null) | undefined;
query_status?: (QueryStatus | null) | undefined;
resolved_compare_date_range?:
| (ResolvedDateRangeResponse | null)
@@ -3608,9 +3609,11 @@ export namespace Schemas {
hogql?: (string | null) | undefined;
modifiers?: (HogQLQueryModifiers | null) | undefined;
preComputeIneligibleReason?: (string | null) | undefined;
+ preComputeStale?: (boolean | null) | undefined;
preComputeStrategy?:
| (WebAnalyticsPreComputeStrategy | null)
| undefined;
+ preComputedAt?: (string | null) | undefined;
query_status?: (QueryStatus | null) | undefined;
resolved_compare_date_range?:
| (ResolvedDateRangeResponse | null)
@@ -6742,9 +6745,11 @@ export namespace Schemas {
hogql?: (string | null) | undefined;
modifiers?: (HogQLQueryModifiers | null) | undefined;
preComputeIneligibleReason?: (string | null) | undefined;
+ preComputeStale?: (boolean | null) | undefined;
preComputeStrategy?:
| (WebAnalyticsPreComputeStrategy | null)
| undefined;
+ preComputedAt?: (string | null) | undefined;
query_status?: (QueryStatus | null) | undefined;
resolved_compare_date_range?:
| (ResolvedDateRangeResponse | null)
@@ -6775,6 +6780,7 @@ export namespace Schemas {
preComputeStrategy?:
| (WebAnalyticsPreComputeStrategy | null)
| undefined;
+ preComputedAt?: (string | null) | undefined;
query_status?: (QueryStatus | null) | undefined;
resolved_compare_date_range?:
| (ResolvedDateRangeResponse | null)
@@ -6853,9 +6859,11 @@ export namespace Schemas {
modifiers?: (HogQLQueryModifiers | null) | undefined;
offset?: (number | null) | undefined;
preComputeIneligibleReason?: (string | null) | undefined;
+ preComputeStale?: (boolean | null) | undefined;
preComputeStrategy?:
| (WebAnalyticsPreComputeStrategy | null)
| undefined;
+ preComputedAt?: (string | null) | undefined;
query_status?: (QueryStatus | null) | undefined;
resolved_compare_date_range?:
| (ResolvedDateRangeResponse | null)
@@ -6888,9 +6896,11 @@ export namespace Schemas {
hogql?: (string | null) | undefined;
modifiers?: (HogQLQueryModifiers | null) | undefined;
preComputeIneligibleReason?: (string | null) | undefined;
+ preComputeStale?: (boolean | null) | undefined;
preComputeStrategy?:
| (WebAnalyticsPreComputeStrategy | null)
| undefined;
+ preComputedAt?: (string | null) | undefined;
query_status?: (QueryStatus | null) | undefined;
resolved_compare_date_range?:
| (ResolvedDateRangeResponse | null)
@@ -7815,9 +7825,11 @@ export namespace Schemas {
modifiers?: (HogQLQueryModifiers | null) | undefined;
offset?: (number | null) | undefined;
preComputeIneligibleReason?: (string | null) | undefined;
+ preComputeStale?: (boolean | null) | undefined;
preComputeStrategy?:
| (WebAnalyticsPreComputeStrategy | null)
| undefined;
+ preComputedAt?: (string | null) | undefined;
query_status?: (QueryStatus | null) | undefined;
resolved_compare_date_range?:
| (ResolvedDateRangeResponse | null)
@@ -7919,9 +7931,11 @@ export namespace Schemas {
hogql?: (string | null) | undefined;
modifiers?: (HogQLQueryModifiers | null) | undefined;
preComputeIneligibleReason?: (string | null) | undefined;
+ preComputeStale?: (boolean | null) | undefined;
preComputeStrategy?:
| (WebAnalyticsPreComputeStrategy | null)
| undefined;
+ preComputedAt?: (string | null) | undefined;
query_status?: (QueryStatus | null) | undefined;
resolved_compare_date_range?:
| (ResolvedDateRangeResponse | null)
diff --git a/products/persons/frontend/generated/api.schemas.ts b/products/persons/frontend/generated/api.schemas.ts
index 2a8fcdb7a1a5..acb75cca0bb6 100644
--- a/products/persons/frontend/generated/api.schemas.ts
+++ b/products/persons/frontend/generated/api.schemas.ts
@@ -3703,6 +3703,8 @@ export interface WebStatsTableQueryResponseApi {
/** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -3797,7 +3799,11 @@ export interface WebOverviewQueryResponseApi {
modifiers?: HogQLQueryModifiersApi | null
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
diff --git a/products/product_analytics/frontend/generated/api.schemas.ts b/products/product_analytics/frontend/generated/api.schemas.ts
index dbee4de9ca81..0c350297bb78 100644
--- a/products/product_analytics/frontend/generated/api.schemas.ts
+++ b/products/product_analytics/frontend/generated/api.schemas.ts
@@ -3589,6 +3589,8 @@ export interface WebStatsTableQueryResponseApi {
/** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -3683,7 +3685,11 @@ export interface WebOverviewQueryResponseApi {
modifiers?: HogQLQueryModifiersApi | null
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -4039,7 +4045,11 @@ export interface Response4Api {
modifiers?: HogQLQueryModifiersApi | null
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -4072,6 +4082,8 @@ export interface Response5Api {
/** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -4157,7 +4169,11 @@ export interface Response8Api {
offset?: number | null
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -4195,7 +4211,11 @@ export interface Response9Api {
modifiers?: HogQLQueryModifiersApi | null
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -6101,7 +6121,11 @@ export interface WebGoalsQueryResponseApi {
offset?: number | null
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -6224,7 +6248,11 @@ export interface WebVitalsPathBreakdownQueryResponseApi {
modifiers?: HogQLQueryModifiersApi | null
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null
preComputeStrategy?: WebAnalyticsPreComputeStrategyApi | null
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatusApi | null
/** The resolved previous/comparison period date range, when comparing against another period */
diff --git a/products/web_analytics/backend/hogql_queries/stats_table.py b/products/web_analytics/backend/hogql_queries/stats_table.py
index 13f281f2ce70..c7d695d971fc 100644
--- a/products/web_analytics/backend/hogql_queries/stats_table.py
+++ b/products/web_analytics/backend/hogql_queries/stats_table.py
@@ -29,7 +29,7 @@ from posthog.hogql.property import (
)
from posthog.hogql.visitor import TraversingVisitor
-from posthog.clickhouse.query_tagging import clear_tag, get_query_tag_value
+from posthog.clickhouse.query_tagging import clear_tag
from posthog.hogql_queries.paginators import HogQLHasMorePaginator
from products.web_analytics.backend.hogql_queries.first_pageview_attribution import (
@@ -581,12 +581,6 @@ WHERE and(
query_type="stats_table_session_id_set_preflight",
)
- def _lazy_precompute_stale(self) -> Optional[bool]:
- # The lazy modules mark serve-stale reads via tag_queries(precompute_stale=True)
- # before executing the read; surfacing it on the response lets clients (and the
- # frontend's 'query completed' telemetry) see it too. None when served fresh.
- return True if get_query_tag_value("precompute_stale") else None
-
def get_lazy_precomputed_result(self) -> Optional[LazyStatsResult]:
if self.query.includeTrafficMetrics or not can_use_lazy_precompute(self):
return None
@@ -620,7 +614,8 @@ WHERE and(
results=results,
modifiers=self.modifiers,
preComputeStrategy=WebAnalyticsPreComputeStrategy.LAZY_PRECOMPUTE,
- preComputeStale=self._lazy_precompute_stale(),
+ preComputeStale=self.lazy_precompute_stale(),
+ preComputedAt=self.lazy_precompute_computed_at_iso(),
hasMore=result.has_more,
limit=self.paginator.limit,
offset=self.paginator.offset,
@@ -713,7 +708,8 @@ WHERE and(
results=results,
modifiers=self.modifiers,
preComputeStrategy=WebAnalyticsPreComputeStrategy.LAZY_PRECOMPUTE,
- preComputeStale=self._lazy_precompute_stale(),
+ preComputeStale=self.lazy_precompute_stale(),
+ preComputedAt=self.lazy_precompute_computed_at_iso(),
hasMore=has_more,
limit=limit,
offset=offset,
@@ -776,7 +772,8 @@ WHERE and(
results=results,
modifiers=self.modifiers,
preComputeStrategy=WebAnalyticsPreComputeStrategy.LAZY_PRECOMPUTE,
- preComputeStale=self._lazy_precompute_stale(),
+ preComputeStale=self.lazy_precompute_stale(),
+ preComputedAt=self.lazy_precompute_computed_at_iso(),
hasMore=has_more,
limit=limit,
offset=offset,
diff --git a/products/web_analytics/backend/hogql_queries/test/test_web_lazy_precompute_common.py b/products/web_analytics/backend/hogql_queries/test/test_web_lazy_precompute_common.py
index 38bfa55b7fc5..bde11377fc63 100644
--- a/products/web_analytics/backend/hogql_queries/test/test_web_lazy_precompute_common.py
+++ b/products/web_analytics/backend/hogql_queries/test/test_web_lazy_precompute_common.py
@@ -1,6 +1,6 @@
import json
import time
-from datetime import UTC, datetime
+from datetime import UTC, datetime, timedelta, timezone
import time_machine
from posthog.test.base import APIBaseTest, BaseTest, ClickhouseTestMixin
@@ -1301,6 +1301,41 @@ class TestServeLiveWarmBehind(BaseTest):
)
mock_enqueue.assert_not_called()
+ @parameterized.expand(
+ [
+ (
+ "oldest_of_current_and_previous_in_utc",
+ [
+ (True, datetime(2024, 1, 15, 11, 0, tzinfo=UTC)),
+ (True, datetime(2024, 1, 15, 11, 30, tzinfo=timezone(timedelta(hours=2)))),
+ ],
+ "2024-01-15T09:30:00+00:00",
+ ),
+ (
+ "miss_does_not_count",
+ [
+ (False, datetime(2024, 1, 15, 8, 0, tzinfo=UTC)),
+ (True, datetime(2024, 1, 15, 11, 0, tzinfo=UTC)),
+ ],
+ "2024-01-15T11:00:00+00:00",
+ ),
+ ("nothing_served", [(False, None)], None),
+ ]
+ )
+ @mock.patch(f"{_COMMON}.record_sticky_warm_shape")
+ @mock.patch(f"{_COMMON}.enqueue_stale_revalidation")
+ @mock.patch(f"{_COMMON}.ensure_precomputed")
+ def test_runner_reports_oldest_served_computed_at(
+ self, _name, ensures, expected, mock_ensure, _mock_enqueue, _mock_sticky
+ ):
+ runner = WebOverviewQueryRunner(team=self.team, query=_overview())
+ for ready, computed_at in ensures:
+ mock_ensure.return_value = LazyComputationResult(ready=ready, job_ids=[], computed_at=computed_at)
+ web_ensure_precomputed(
+ team=self.team, runner=runner, family="web_overview", ttl_seconds={"default": 3600}, table=None
+ )
+ assert runner.lazy_precompute_computed_at_iso() == expected
+
@mock.patch(f"{_COMMON}.enqueue_stale_revalidation")
@mock.patch(f"{_COMMON}.ensure_precomputed")
def test_background_warming_still_inserts_inline(self, mock_ensure, mock_enqueue):
diff --git a/products/web_analytics/backend/hogql_queries/test/test_web_overview_lazy_precompute.py b/products/web_analytics/backend/hogql_queries/test/test_web_overview_lazy_precompute.py
index 4da111e364ad..db09246056aa 100644
--- a/products/web_analytics/backend/hogql_queries/test/test_web_overview_lazy_precompute.py
+++ b/products/web_analytics/backend/hogql_queries/test/test_web_overview_lazy_precompute.py
@@ -19,6 +19,7 @@ from posthog.schema import (
PropertyOperator,
SessionPropertyFilter,
SessionsV2JoinMode,
+ WebAnalyticsPreComputeStrategy,
WebAnalyticsSampling,
WebOverviewQuery,
)
@@ -28,6 +29,7 @@ from posthog.hogql.context import HogQLContext
from posthog.hogql.printer import prepare_and_print_ast
from posthog.clickhouse.client import sync_execute
+from posthog.clickhouse.query_tagging import tags_context
from posthog.models.utils import uuid7
from products.analytics_platform.backend.lazy_computation.lazy_computation_executor import LazyComputationResult
@@ -445,12 +447,18 @@ class TestWebOverviewLazyPrecompute(ClickhouseTestMixin, APIBaseTest):
raw_visitors = raw_response.results[0]
raw_sessions = raw_response.results[2]
- # Path B: lazy precompute, compare=True. Must match the raw response.
+ # Path B: lazy precompute, compare=True. Must match the raw response. User-facing reads
+ # never insert inline, so a background-triggered pass builds both periods first.
with self._enable_lazy():
+ with tags_context(trigger="webAnalyticsEagerBaselineWarming"):
+ self._run(self._build_query(compare=True))
lazy_response = self._run(self._build_query(compare=True))
lazy_visitors = lazy_response.results[0]
lazy_sessions = lazy_response.results[2]
+ assert lazy_response.preComputeStrategy == WebAnalyticsPreComputeStrategy.LAZY_PRECOMPUTE
+ assert lazy_response.preComputedAt == "2024-01-15T12:00:00+00:00"
+ assert raw_response.preComputedAt is None
assert lazy_visitors.previous == raw_visitors.previous, (
f"previous visitors mismatch: lazy={lazy_visitors.previous}, raw={raw_visitors.previous}. "
f"If lazy is 0/None, the previous-period precompute is missing."
diff --git a/products/web_analytics/backend/hogql_queries/test/test_web_stats_lazy_precompute.py b/products/web_analytics/backend/hogql_queries/test/test_web_stats_lazy_precompute.py
index dada2a2d1fd5..bd6bfb68cb60 100644
--- a/products/web_analytics/backend/hogql_queries/test/test_web_stats_lazy_precompute.py
+++ b/products/web_analytics/backend/hogql_queries/test/test_web_stats_lazy_precompute.py
@@ -219,7 +219,8 @@ class TestWebStatsLazyPrecompute(ClickhouseTestMixin, APIBaseTest):
def test_lazy_matches_raw(self, _name: str, breakdown_by: WebStatsBreakdown):
self._seed()
- raw = self._metrics(self._run(self._build_query(breakdown_by=breakdown_by)))
+ raw_response = self._run(self._build_query(breakdown_by=breakdown_by))
+ raw = self._metrics(raw_response)
with self._enable_lazy():
lazy_response = self._run(self._build_query(breakdown_by=breakdown_by))
@@ -230,6 +231,8 @@ class TestWebStatsLazyPrecompute(ClickhouseTestMixin, APIBaseTest):
).count()
assert ready_jobs > 0, f"expected a READY precompute job for {breakdown_by}"
assert lazy_response.preComputeStrategy == WebAnalyticsPreComputeStrategy.LAZY_PRECOMPUTE
+ assert lazy_response.preComputedAt == "2024-01-15T12:00:00+00:00"
+ assert raw_response.preComputedAt is None
assert lazy == raw, f"lazy/raw mismatch for {breakdown_by}: raw={raw}, lazy={lazy}"
@time_machine.travel("2024-01-15T12:00:00Z", tick=False)
diff --git a/products/web_analytics/backend/hogql_queries/web_analytics_query_runner.py b/products/web_analytics/backend/hogql_queries/web_analytics_query_runner.py
index b659ec104edb..783388c57e64 100644
--- a/products/web_analytics/backend/hogql_queries/web_analytics_query_runner.py
+++ b/products/web_analytics/backend/hogql_queries/web_analytics_query_runner.py
@@ -1,6 +1,6 @@
import typing
from abc import ABC
-from datetime import datetime, timedelta
+from datetime import UTC, datetime, timedelta
from functools import cached_property
from math import ceil
from time import perf_counter
@@ -111,11 +111,29 @@ class WebAnalyticsQueryRunner(AnalyticsQueryRunner[WAR], ABC):
query: WebQueryNode
query_type: type[WebQueryNode]
bypass_warehouse_access_control: bool = False
+ # The oldest `computed_at` across every lazy precompute ensure that this runner served from.
+ # A response that combines several windows (current and compare periods) is only as fresh as its stalest window.
+ lazy_precompute_computed_at: Optional[datetime] = None
def __init__(self, *args: Any, bypass_warehouse_access_control: bool = False, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
self.bypass_warehouse_access_control = bypass_warehouse_access_control
+ def record_lazy_precompute_computed_at(self, computed_at: datetime) -> None:
+ if self.lazy_precompute_computed_at is None or computed_at < self.lazy_precompute_computed_at:
+ self.lazy_precompute_computed_at = computed_at
+
+ def lazy_precompute_stale(self) -> Optional[bool]:
+ # The lazy modules mark serve-stale reads via tag_queries(precompute_stale=True)
+ # before executing the read; surfacing it on the response lets clients (and the
+ # frontend's 'query completed' telemetry) see it too. None when served fresh.
+ return True if get_query_tag_value("precompute_stale") else None
+
+ def lazy_precompute_computed_at_iso(self) -> Optional[str]:
+ if self.lazy_precompute_computed_at is None:
+ return None
+ return self.lazy_precompute_computed_at.astimezone(UTC).isoformat()
+
def get_cache_payload(self) -> dict:
payload = super().get_cache_payload()
# The base fingerprint does not see a warehouse table that a test-account filter reads through a join,
diff --git a/products/web_analytics/backend/hogql_queries/web_goals.py b/products/web_analytics/backend/hogql_queries/web_goals.py
index 95f933a24a88..f959201ebe7a 100644
--- a/products/web_analytics/backend/hogql_queries/web_goals.py
+++ b/products/web_analytics/backend/hogql_queries/web_goals.py
@@ -348,6 +348,8 @@ WHERE {periods_expression}
results=results,
modifiers=self.modifiers,
preComputeStrategy=WebAnalyticsPreComputeStrategy.LAZY_PRECOMPUTE,
+ preComputeStale=self.lazy_precompute_stale(),
+ preComputedAt=self.lazy_precompute_computed_at_iso(),
)
def event_properties(self) -> ast.Expr:
diff --git a/products/web_analytics/backend/hogql_queries/web_lazy_precompute_common.py b/products/web_analytics/backend/hogql_queries/web_lazy_precompute_common.py
index 99cc3ac5e347..b5e7d3c8564a 100644
--- a/products/web_analytics/backend/hogql_queries/web_lazy_precompute_common.py
+++ b/products/web_analytics/backend/hogql_queries/web_lazy_precompute_common.py
@@ -713,6 +713,8 @@ def web_ensure_precomputed(
schedule = replace(schedule, rules=[(forced_cutoff, 1), *schedule.rules])
kwargs["ttl_seconds"] = schedule
result = ensure_precomputed(team=team, **kwargs)
+ if result.ready and result.computed_at is not None and runner is not None:
+ runner.record_lazy_precompute_computed_at(result.computed_at)
if not result.ready and not background and runner is not None and family is not None:
# Check-only miss: warm in the background (debounced per team/family/shape)
# so the next visit is served from precompute while this one goes live.
diff --git a/products/web_analytics/backend/hogql_queries/web_overview.py b/products/web_analytics/backend/hogql_queries/web_overview.py
index f9cb48eca76f..8c705a89f743 100644
--- a/products/web_analytics/backend/hogql_queries/web_overview.py
+++ b/products/web_analytics/backend/hogql_queries/web_overview.py
@@ -325,6 +325,8 @@ CROSS JOIN {sessions_agg} AS sessions_agg
dateFrom=self.query_date_range.date_from_str,
dateTo=self.query_date_range.date_to_str,
preComputeStrategy=WebAnalyticsPreComputeStrategy.LAZY_PRECOMPUTE,
+ preComputeStale=self.lazy_precompute_stale(),
+ preComputedAt=self.lazy_precompute_computed_at_iso(),
)
@cached_property
@@ -435,6 +437,8 @@ WHERE and(
dateTo=self.query_date_range.date_to_str,
preComputeStrategy=visitors_response.preComputeStrategy,
preComputeIneligibleReason=visitors_response.preComputeIneligibleReason,
+ preComputeStale=visitors_response.preComputeStale,
+ preComputedAt=visitors_response.preComputedAt,
)
def _calculate(self) -> WebOverviewQueryResponse:
diff --git a/products/web_analytics/backend/hogql_queries/web_vitals_paths_lazy_precompute.py b/products/web_analytics/backend/hogql_queries/web_vitals_paths_lazy_precompute.py
index 9e24c30c7ad2..cb22e254d15e 100644
--- a/products/web_analytics/backend/hogql_queries/web_vitals_paths_lazy_precompute.py
+++ b/products/web_analytics/backend/hogql_queries/web_vitals_paths_lazy_precompute.py
@@ -329,6 +329,8 @@ def _build_response(
timings=runner.timings.to_list() if runner.timings else None,
modifiers=runner.modifiers,
preComputeStrategy=WebAnalyticsPreComputeStrategy.LAZY_PRECOMPUTE,
+ preComputeStale=runner.lazy_precompute_stale(),
+ preComputedAt=runner.lazy_precompute_computed_at_iso(),
)
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 65efc3edb97f..6889f8e453d4 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -6831,6 +6831,8 @@ export namespace Schemas {
/** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
preComputeStale?: boolean | null;
preComputeStrategy?: WebAnalyticsPreComputeStrategy | null;
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null;
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatus | null;
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -6921,7 +6923,11 @@ export namespace Schemas {
modifiers?: HogQLQueryModifiers | null;
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null;
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null;
preComputeStrategy?: WebAnalyticsPreComputeStrategy | null;
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null;
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatus | null;
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -7986,7 +7992,11 @@ export namespace Schemas {
modifiers?: HogQLQueryModifiers | null;
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null;
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null;
preComputeStrategy?: WebAnalyticsPreComputeStrategy | null;
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null;
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatus | null;
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -8019,6 +8029,8 @@ export namespace Schemas {
/** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
preComputeStale?: boolean | null;
preComputeStrategy?: WebAnalyticsPreComputeStrategy | null;
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null;
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatus | null;
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -8104,7 +8116,11 @@ export namespace Schemas {
offset?: number | null;
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null;
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null;
preComputeStrategy?: WebAnalyticsPreComputeStrategy | null;
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null;
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatus | null;
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -8142,7 +8158,11 @@ export namespace Schemas {
modifiers?: HogQLQueryModifiers | null;
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null;
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null;
preComputeStrategy?: WebAnalyticsPreComputeStrategy | null;
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null;
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatus | null;
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -9070,7 +9090,11 @@ export namespace Schemas {
offset?: number | null;
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null;
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null;
preComputeStrategy?: WebAnalyticsPreComputeStrategy | null;
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null;
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatus | null;
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -9176,7 +9200,11 @@ export namespace Schemas {
modifiers?: HogQLQueryModifiers | null;
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null;
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null;
preComputeStrategy?: WebAnalyticsPreComputeStrategy | null;
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null;
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatus | null;
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -96711,7 +96739,11 @@ export namespace Schemas {
modifiers?: HogQLQueryModifiers | null;
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null;
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null;
preComputeStrategy?: WebAnalyticsPreComputeStrategy | null;
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null;
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatus | null;
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -96744,6 +96776,8 @@ export namespace Schemas {
/** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
preComputeStale?: boolean | null;
preComputeStrategy?: WebAnalyticsPreComputeStrategy | null;
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null;
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatus | null;
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -96829,7 +96863,11 @@ export namespace Schemas {
offset?: number | null;
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null;
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null;
preComputeStrategy?: WebAnalyticsPreComputeStrategy | null;
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null;
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatus | null;
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -96856,7 +96894,11 @@ export namespace Schemas {
modifiers?: HogQLQueryModifiers | null;
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null;
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null;
preComputeStrategy?: WebAnalyticsPreComputeStrategy | null;
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null;
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatus | null;
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -97260,7 +97302,11 @@ export namespace Schemas {
modifiers?: HogQLQueryModifiers | null;
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null;
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null;
preComputeStrategy?: WebAnalyticsPreComputeStrategy | null;
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null;
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatus | null;
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -97293,6 +97339,8 @@ export namespace Schemas {
/** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
preComputeStale?: boolean | null;
preComputeStrategy?: WebAnalyticsPreComputeStrategy | null;
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null;
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatus | null;
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -97378,7 +97426,11 @@ export namespace Schemas {
offset?: number | null;
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null;
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null;
preComputeStrategy?: WebAnalyticsPreComputeStrategy | null;
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null;
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatus | null;
/** The resolved previous/comparison period date range, when comparing against another period */
@@ -97405,7 +97457,11 @@ export namespace Schemas {
modifiers?: HogQLQueryModifiers | null;
/** Why a live response skipped precompute: the eligibility-gate reason that refused it. Unset when the query was eligible. */
preComputeIneligibleReason?: string | null;
+ /** Whether a lazy-precompute read was served from expired-within-grace (stale) jobs instead of recomputing inline. */
+ preComputeStale?: boolean | null;
preComputeStrategy?: WebAnalyticsPreComputeStrategy | null;
+ /** When the oldest precomputed window this response used was computed. Unset for live responses. */
+ preComputedAt?: string | null;
/** Query status indicates whether next to the provided data, a query is still running. */
query_status?: QueryStatus | null;
/** The resolved previous/comparison period date range, when comparing against another period */