: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
fix(cdp): show logs in transformation invocations tab (#80303)
posthog[bot]a6508a72de66
diff --git a/frontend/src/scenes/hog-functions/HogFunctionScene.tsx b/frontend/src/scenes/hog-functions/HogFunctionScene.tsxindex 8a28d13beaeb..8c8d5c3c1235 100644--- a/frontend/src/scenes/hog-functions/HogFunctionScene.tsx+++ b/frontend/src/scenes/hog-functions/HogFunctionScene.tsx@@ -56,6 +56,7 @@ import {import { HogFunctionIconEditable } from './configuration/HogFunctionIcon'import { humanizeHogFunctionType } from './hog-function-utils'import { HogInvocations } from './invocations/HogInvocations'+import { TransformationInvocations } from './invocations/TransformationInvocations'import { HogFunctionMetrics } from './metrics/HogFunctionMetrics'import { HogFunctionSkeleton } from './misc/HogFunctionSkeleton'import { HogFunctionRuns } from './runs/HogFunctionRuns'@@ -535,7 +536,14 @@ export function HogFunctionScene(): JSX.Element {: {label: 'Invocations',key: 'invocations',- content: <HogInvocations id={id} functionKind="hog_function" hogFunctionType={type} />,+ // Transformations never write `hog_invocation_results`, so show their per-run logs+ // instead of the always-empty table (see TransformationInvocations).+ content:+ type === 'transformation' ? (+ <TransformationInvocations id={id} onViewMetrics={() => setCurrentTab('metrics')} />+ ) : (+ <HogInvocations id={id} functionKind="hog_function" hogFunctionType={type} />+ ),},supportsBackfills && featureFlags[FEATURE_FLAGS.BACKFILL_WORKFLOWS_DESTINATION]diff --git a/frontend/src/scenes/hog-functions/invocations/TransformationInvocations.tsx b/frontend/src/scenes/hog-functions/invocations/TransformationInvocations.tsxnew file mode 100644index 000000000000..fbbfb76ccf3d--- /dev/null+++ b/frontend/src/scenes/hog-functions/invocations/TransformationInvocations.tsx@@ -0,0 +1,33 @@+import { LemonBanner } from '@posthog/lemon-ui'++import { Link } from 'lib/lemon-ui/Link'++import { LogsViewer } from '../logs/LogsViewer'+import { renderHogFunctionMessage } from '../logs/renderHogFunctionMessage'++// Transformations run in the ingestion pipeline, not on a cyclotron worker, so they never write to+// `hog_invocation_results`. The standard invocations table would always be empty for them. They do+// write log lines to `log_entries` (source `hog_function`, keyed by function id), so surface those+// here grouped per run, and point at Metrics for success and failure counts.+export function TransformationInvocations({+ id,+ onViewMetrics,+}: {+ id: string+ onViewMetrics: () => void+}): JSX.Element {+ return (+ <div className="flex flex-col gap-2">+ <LemonBanner type="info">+ Transformations don't store individual runs like destinations do. Each row below is one run and the log+ lines it wrote. For success and failure counts, open the <Link onClick={onViewMetrics}>Metrics</Link>{' '}+ tab.+ </LemonBanner>+ <LogsViewer+ sourceType="hog_function"+ sourceId={id}+ renderMessage={(message) => renderHogFunctionMessage(message)}+ />+ </div>+ )+}