: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(logs): add logs to onboarding flow (#56964)
Fernando Gomesf16a556598fc
diff --git a/docs/onboarding/logs/go.tsx b/docs/onboarding/logs/go.tsxnew file mode 100644index 000000000000..ded627544fb4--- /dev/null+++ b/docs/onboarding/logs/go.tsx@@ -0,0 +1,146 @@+import { OnboardingComponentsContext, createInstallation } from 'scenes/onboarding/OnboardingDocsContentWrapper'++import { StepDefinition } from '../steps'++export const getGoSteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {+ const { CodeBlock, Markdown, dedent } = ctx++ return [+ {+ title: 'Install dependencies',+ badge: 'required',+ content: (+ <>+ <Markdown>+ PostHog logs uses the standard OpenTelemetry SDK. No PostHog-specific packages required.+ </Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'bash',+ file: 'go',+ code: dedent`+ go get go.opentelemetry.io/otel+ go get go.opentelemetry.io/otel/sdk+ go get go.opentelemetry.io/otel/log+ go get go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp+ go get go.opentelemetry.io/otel/sdk/log+ `,+ },+ ]}+ />+ </>+ ),+ },+ {+ title: 'Configure the OTLP log exporter',+ badge: 'required',+ content: (+ <>+ <Markdown>Configure the OpenTelemetry log exporter to send logs to PostHog:</Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'go',+ file: 'instrumentation.go',+ code: dedent`+ package main++ import (+ "context"++ "go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp"+ "go.opentelemetry.io/otel/log/global"+ sdklog "go.opentelemetry.io/otel/sdk/log"+ "go.opentelemetry.io/otel/sdk/resource"+ semconv "go.opentelemetry.io/otel/semconv/v1.26.0"+ )++ func setupLogging(ctx context.Context) (*sdklog.LoggerProvider, error) {+ exporter, err := otlploghttp.New(ctx,+ otlploghttp.WithEndpointURL("<ph_client_api_host>/otlp/v1/logs"),+ otlploghttp.WithHeaders(map[string]string{+ "Authorization": "Bearer <ph_project_token>",+ }),+ )+ if err != nil {+ return nil, err+ }++ res := resource.NewWithAttributes(+ semconv.SchemaURL,+ semconv.ServiceName("my-app"),+ )++ provider := sdklog.NewLoggerProvider(+ sdklog.WithProcessor(sdklog.NewBatchProcessor(exporter)),+ sdklog.WithResource(res),+ )++ global.SetLoggerProvider(provider)+ return provider, nil+ }+ `,+ },+ ]}+ />+ </>+ ),+ },+ {+ title: 'Send a log',+ badge: 'required',+ content: (+ <>+ <Markdown>Use the OpenTelemetry logger to emit logs from your application:</Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'go',+ file: 'main.go',+ code: dedent`+ package main++ import (+ "context"+ "log"++ "go.opentelemetry.io/otel/log/global"+ semconv "go.opentelemetry.io/otel/semconv/v1.26.0"+ otellog "go.opentelemetry.io/otel/log"+ )++ func main() {+ ctx := context.Background()++ provider, err := setupLogging(ctx)+ if err != nil {+ log.Fatal(err)+ }+ defer provider.Shutdown(ctx)++ logger := global.Logger("my-app")++ var record otellog.Record+ record.SetSeverity(otellog.SeverityInfo)+ record.SetBody(otellog.StringValue("Application started"))+ record.AddAttributes(+ otellog.Int64("server.port", 8080),+ )+ logger.Emit(ctx, record)+ }+ `,+ },+ ]}+ />+ <Markdown>+ Logs appear in PostHog within a few seconds. Use the [Logs page](/logs) to search and filter by+ service name, severity, or any attribute you attach.+ </Markdown>+ </>+ ),+ },+ ]+}++export const GoInstallation = createInstallation(getGoSteps)diff --git a/docs/onboarding/logs/index.ts b/docs/onboarding/logs/index.tsnew file mode 100644index 000000000000..33aea8b64867--- /dev/null+++ b/docs/onboarding/logs/index.ts@@ -0,0 +1,6 @@+export { GoInstallation } from './go'+export { JavaInstallation } from './java'+export { NextJSInstallation } from './nextjs'+export { NodeJSInstallation } from './nodejs'+export { OpenTelemetryInstallation } from './opentelemetry'+export { PythonInstallation } from './python'diff --git a/docs/onboarding/logs/java.tsx b/docs/onboarding/logs/java.tsxnew file mode 100644index 000000000000..07f61db4721c--- /dev/null+++ b/docs/onboarding/logs/java.tsx@@ -0,0 +1,158 @@+import { OnboardingComponentsContext, createInstallation } from 'scenes/onboarding/OnboardingDocsContentWrapper'++import { StepDefinition } from '../steps'++export const getJavaSteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {+ const { CodeBlock, Markdown, dedent } = ctx++ return [+ {+ title: 'Add dependencies',+ badge: 'required',+ content: (+ <>+ <Markdown>+ PostHog logs uses the standard OpenTelemetry SDK — no PostHog-specific packages required. Add+ the OTel SDK BOM and the OTLP log exporter:+ </Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'xml',+ file: 'Maven (pom.xml)',+ code: dedent`+ <dependencyManagement>+ <dependencies>+ <dependency>+ <groupId>io.opentelemetry</groupId>+ <artifactId>opentelemetry-bom</artifactId>+ <version>1.47.0</version>+ <type>pom</type>+ <scope>import</scope>+ </dependency>+ </dependencies>+ </dependencyManagement>++ <dependencies>+ <dependency>+ <groupId>io.opentelemetry</groupId>+ <artifactId>opentelemetry-sdk-logs</artifactId>+ </dependency>+ <dependency>+ <groupId>io.opentelemetry</groupId>+ <artifactId>opentelemetry-exporter-otlp</artifactId>+ </dependency>+ </dependencies>+ `,+ },+ {+ language: 'groovy',+ file: 'Gradle (build.gradle)',+ code: dedent`+ dependencies {+ implementation platform('io.opentelemetry:opentelemetry-bom:1.47.0')+ implementation 'io.opentelemetry:opentelemetry-sdk-logs'+ implementation 'io.opentelemetry:opentelemetry-exporter-otlp'+ }+ `,+ },+ ]}+ />+ </>+ ),+ },+ {+ title: 'Configure the OTLP log exporter',+ badge: 'required',+ content: (+ <>+ <Markdown>Configure the OpenTelemetry log exporter to send logs to PostHog:</Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'java',+ file: 'Instrumentation.java',+ code: dedent`+ import io.opentelemetry.api.logs.Logger;+ import io.opentelemetry.exporter.otlp.logs.OtlpGrpcLogRecordExporter;+ import io.opentelemetry.sdk.logs.SdkLoggerProvider;+ import io.opentelemetry.sdk.logs.export.BatchLogRecordProcessor;+ import io.opentelemetry.sdk.resources.Resource;+ import io.opentelemetry.semconv.resource.attributes.ResourceAttributes;++ public class Instrumentation {+ public static Logger setupLogger() {+ Resource resource = Resource.getDefault()+ .merge(Resource.create(+ io.opentelemetry.api.common.Attributes.of(+ ResourceAttributes.SERVICE_NAME, "my-app"+ )+ ));++ OtlpGrpcLogRecordExporter exporter = OtlpGrpcLogRecordExporter.builder()+ .setEndpoint("<ph_client_api_host>/otlp")+ .addHeader("Authorization", "Bearer <ph_project_token>")+ .build();++ SdkLoggerProvider loggerProvider = SdkLoggerProvider.builder()+ .setResource(resource)+ .addLogRecordProcessor(BatchLogRecordProcessor.create(exporter))+ .build();++ return loggerProvider.get("my-app");+ }+ }+ `,+ },+ ]}+ />+ </>+ ),+ },+ {+ title: 'Send a log',+ badge: 'required',+ content: (+ <>+ <Markdown>Use the OpenTelemetry logger to emit logs from your application:</Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'java',+ file: 'App.java',+ code: dedent`+ import io.opentelemetry.api.common.AttributeKey;+ import io.opentelemetry.api.common.Attributes;+ import io.opentelemetry.api.logs.Logger;+ import io.opentelemetry.api.logs.Severity;++ public class App {+ public static void main(String[] args) {+ Logger logger = Instrumentation.setupLogger();++ logger.logRecordBuilder()+ .setSeverity(Severity.INFO)+ .setSeverityText("INFO")+ .setBody("User signed up")+ .setAllAttributes(Attributes.of(+ AttributeKey.stringKey("user.id"), "user_123",+ AttributeKey.stringKey("user.plan"), "pro"+ ))+ .emit();+ }+ }+ `,+ },+ ]}+ />+ <Markdown>+ Logs appear in PostHog within a few seconds. Use the [Logs page](/logs) to search and filter by+ service name, severity, or any attribute you attach.+ </Markdown>+ </>+ ),+ },+ ]+}++export const JavaInstallation = createInstallation(getJavaSteps)diff --git a/docs/onboarding/logs/nextjs.tsx b/docs/onboarding/logs/nextjs.tsxnew file mode 100644index 000000000000..bef726b8311c--- /dev/null+++ b/docs/onboarding/logs/nextjs.tsx@@ -0,0 +1,164 @@+import { OnboardingComponentsContext, createInstallation } from 'scenes/onboarding/OnboardingDocsContentWrapper'++import { StepDefinition } from '../steps'++export const getNextJSSteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {+ const { CodeBlock, Markdown, dedent } = ctx++ return [+ {+ title: 'Install dependencies',+ badge: 'required',+ content: (+ <>+ <Markdown>+ PostHog logs uses the standard OpenTelemetry SDK. No PostHog-specific packages required. Install+ the OTel SDK and the logs signal package:+ </Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'bash',+ file: 'npm',+ code: dedent`+ npm install @opentelemetry/sdk-logs @opentelemetry/exporter-logs-otlp-http @opentelemetry/resources+ `,+ },+ {+ language: 'bash',+ file: 'yarn',+ code: dedent`+ yarn add @opentelemetry/sdk-logs @opentelemetry/exporter-logs-otlp-http @opentelemetry/resources+ `,+ },+ {+ language: 'bash',+ file: 'pnpm',+ code: dedent`+ pnpm add @opentelemetry/sdk-logs @opentelemetry/exporter-logs-otlp-http @opentelemetry/resources+ `,+ },+ {+ language: 'bash',+ file: 'bun',+ code: dedent`+ bun add @opentelemetry/sdk-logs @opentelemetry/exporter-logs-otlp-http @opentelemetry/resources+ `,+ },+ ]}+ />+ </>+ ),+ },+ {+ title: 'Create an instrumentation file',+ badge: 'required',+ content: (+ <>+ <Markdown>+ {dedent`+ Next.js loads \`instrumentation.ts\` (or \`instrumentation.js\`) at startup.+ Add the log exporter configuration there:+ `}+ </Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'typescript',+ file: 'instrumentation.ts',+ code: dedent`+ import { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http'+ import { resourceFromAttributes } from '@opentelemetry/resources'+ import { LoggerProvider, SimpleLogRecordProcessor } from '@opentelemetry/sdk-logs'++ export function register() {+ if (process.env.NEXT_RUNTIME === 'nodejs') {+ const exporter = new OTLPLogExporter({+ url: '<ph_client_api_host>/otlp/v1/logs',+ headers: {+ Authorization: 'Bearer <ph_project_token>',+ },+ })++ const loggerProvider = new LoggerProvider({+ resource: resourceFromAttributes({+ 'service.name': 'my-nextjs-app',+ }),+ })++ loggerProvider.addLogRecordProcessor(new SimpleLogRecordProcessor(exporter))++ // make the logger available globally+ ;(globalThis as any).__posthogLogger = loggerProvider.getLogger('my-nextjs-app')+ }+ }+ `,+ },+ ]}+ />+ <Markdown>+ {dedent`+ Enable the instrumentation hook in \`next.config.ts\`:+ `}+ </Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'typescript',+ file: 'next.config.ts',+ code: dedent`+ import type { NextConfig } from 'next'++ const nextConfig: NextConfig = {+ experimental: {+ instrumentationHook: true,+ },+ }++ export default nextConfig+ `,+ },+ ]}+ />+ </>+ ),+ },+ {+ title: 'Send a log',+ badge: 'required',+ content: (+ <>+ <Markdown>Use the global logger in your API routes or server components:</Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'typescript',+ file: 'app/api/route.ts',+ code: dedent`+ import { SeverityNumber } from '@opentelemetry/api-logs'++ export async function GET() {+ const logger = (globalThis as any).__posthogLogger+ logger?.emit({+ severityNumber: SeverityNumber.INFO,+ severityText: 'INFO',+ body: 'API route called',+ attributes: { route: '/api' },+ })+ return Response.json({ ok: true })+ }+ `,+ },+ ]}+ />+ <Markdown>+ Logs appear in PostHog within a few seconds. Use the [Logs page](/logs) to search and filter by+ service name, severity, or any attribute you attach.+ </Markdown>+ </>+ ),+ },+ ]+}++export const NextJSInstallation = createInstallation(getNextJSSteps)diff --git a/docs/onboarding/logs/nodejs.tsx b/docs/onboarding/logs/nodejs.tsxnew file mode 100644index 000000000000..05249ff346a4--- /dev/null+++ b/docs/onboarding/logs/nodejs.tsx@@ -0,0 +1,137 @@+import { OnboardingComponentsContext, createInstallation } from 'scenes/onboarding/OnboardingDocsContentWrapper'++import { StepDefinition } from '../steps'++export const getNodeJSSteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {+ const { CodeBlock, Markdown, dedent } = ctx++ return [+ {+ title: 'Install dependencies',+ badge: 'required',+ content: (+ <>+ <Markdown>+ PostHog logs uses the standard OpenTelemetry SDK. No PostHog-specific packages required. Install+ the OTel SDK and the logs signal package:+ </Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'bash',+ file: 'npm',+ code: dedent`+ npm install @opentelemetry/sdk-node @opentelemetry/sdk-logs @opentelemetry/exporter-logs-otlp-http @opentelemetry/resources+ `,+ },+ {+ language: 'bash',+ file: 'yarn',+ code: dedent`+ yarn add @opentelemetry/sdk-node @opentelemetry/sdk-logs @opentelemetry/exporter-logs-otlp-http @opentelemetry/resources+ `,+ },+ {+ language: 'bash',+ file: 'pnpm',+ code: dedent`+ pnpm add @opentelemetry/sdk-node @opentelemetry/sdk-logs @opentelemetry/exporter-logs-otlp-http @opentelemetry/resources+ `,+ },+ {+ language: 'bash',+ file: 'bun',+ code: dedent`+ bun add @opentelemetry/sdk-node @opentelemetry/sdk-logs @opentelemetry/exporter-logs-otlp-http @opentelemetry/resources+ `,+ },+ ]}+ />+ </>+ ),+ },+ {+ title: 'Configure the OTLP log exporter',+ badge: 'required',+ content: (+ <>+ <Markdown>+ {dedent`+ Create a logger setup file that configures the OpenTelemetry log exporter to send logs to+ PostHog. Call this before your application starts.+ `}+ </Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'typescript',+ file: 'logger.ts',+ code: dedent`+ import { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http'+ import { resourceFromAttributes } from '@opentelemetry/resources'+ import { LoggerProvider, SimpleLogRecordProcessor } from '@opentelemetry/sdk-logs'++ const exporter = new OTLPLogExporter({+ url: '<ph_client_api_host>/otlp/v1/logs',+ headers: {+ Authorization: 'Bearer <ph_project_token>',+ },+ })++ const loggerProvider = new LoggerProvider({+ resource: resourceFromAttributes({+ 'service.name': 'my-app',+ }),+ })++ loggerProvider.addLogRecordProcessor(new SimpleLogRecordProcessor(exporter))++ export const logger = loggerProvider.getLogger('my-app')+ `,+ },+ ]}+ />+ </>+ ),+ },+ {+ title: 'Send a log',+ badge: 'required',+ content: (+ <>+ <Markdown>Use the logger to emit logs from your application:</Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'typescript',+ file: 'app.ts',+ code: dedent`+ import { SeverityNumber } from '@opentelemetry/api-logs'+ import { logger } from './logger'++ logger.emit({+ severityNumber: SeverityNumber.INFO,+ severityText: 'INFO',+ body: 'Server started',+ attributes: {+ 'server.port': 3000,+ 'server.env': 'production',+ },+ })+ `,+ },+ ]}+ />+ <Markdown>+ {dedent`+ Logs appear in PostHog within a few seconds. Use the [Logs page](/logs) to search and filter+ by service name, severity, or any attribute you attach.+ `}+ </Markdown>+ </>+ ),+ },+ ]+}++export const NodeJSInstallation = createInstallation(getNodeJSSteps)diff --git a/docs/onboarding/logs/opentelemetry.tsx b/docs/onboarding/logs/opentelemetry.tsxnew file mode 100644index 000000000000..89483cecc280--- /dev/null+++ b/docs/onboarding/logs/opentelemetry.tsx@@ -0,0 +1,78 @@+import { OnboardingComponentsContext, createInstallation } from 'scenes/onboarding/OnboardingDocsContentWrapper'++import { StepDefinition } from '../steps'++export const getOpenTelemetrySteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {+ const { CodeBlock, Markdown, dedent } = ctx++ return [+ {+ title: 'Send logs via OTLP',+ badge: 'required',+ content: (+ <>+ <Markdown>+ {dedent`+ PostHog accepts logs from any OpenTelemetry-compatible client via OTLP over HTTP.+ Point your exporter at PostHog's OTLP endpoint and authenticate with your project token.++ PostHog does not require any PostHog-specific SDK or package — use standard+ OpenTelemetry libraries in any language.+ `}+ </Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'bash',+ file: 'Environment variables',+ code: dedent`+ OTEL_EXPORTER_OTLP_LOGS_ENDPOINT="<ph_client_api_host>/otlp/v1/logs"+ OTEL_EXPORTER_OTLP_LOGS_HEADERS="Authorization=Bearer <ph_project_token>"+ OTEL_SERVICE_NAME="my-app"+ `,+ },+ {+ language: 'yaml',+ file: 'OTel Collector',+ code: dedent`+ receivers:+ otlp:+ protocols:+ http:+ endpoint: 0.0.0.0:4318++ processors:+ batch:++ exporters:+ otlphttp/posthog:+ logs_endpoint: "<ph_client_api_host>/otlp/v1/logs"+ headers:+ Authorization: "Bearer <ph_project_token>"++ service:+ pipelines:+ logs:+ receivers: [otlp]+ processors: [batch]+ exporters: [otlphttp/posthog]+ `,+ },+ ]}+ />+ <Markdown>+ {dedent`+ The endpoint accepts OTLP over HTTP in both \`application/x-protobuf\` and \`application/json\`+ formats. gRPC is not supported, use the HTTP transport protocol instead.++ Logs appear in PostHog within a few seconds. Use the [Logs page](/logs) to search and filter+ by service name, severity, or any attribute you attach.+ `}+ </Markdown>+ </>+ ),+ },+ ]+}++export const OpenTelemetryInstallation = createInstallation(getOpenTelemetrySteps)diff --git a/docs/onboarding/logs/python.tsx b/docs/onboarding/logs/python.tsxnew file mode 100644index 000000000000..4dfbd005e44b--- /dev/null+++ b/docs/onboarding/logs/python.tsx@@ -0,0 +1,108 @@+import { OnboardingComponentsContext, createInstallation } from 'scenes/onboarding/OnboardingDocsContentWrapper'++import { StepDefinition } from '../steps'++export const getPythonSteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {+ const { CodeBlock, Markdown, dedent } = ctx++ return [+ {+ title: 'Install dependencies',+ badge: 'required',+ content: (+ <>+ <Markdown>+ PostHog logs uses the standard OpenTelemetry SDK. No PostHog-specific packages required.+ </Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'bash',+ file: 'pip',+ code: dedent`+ pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-http+ `,+ },+ ]}+ />+ </>+ ),+ },+ {+ title: 'Configure the OTLP log exporter',+ badge: 'required',+ content: (+ <>+ <Markdown>Configure the OpenTelemetry log exporter to send logs to PostHog:</Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'python',+ file: 'instrumentation.py',+ code: dedent`+ from opentelemetry._logs import set_logger_provider+ from opentelemetry.exporter.otlp.proto.http._log_exporter import OTLPLogExporter+ from opentelemetry.sdk._logs import LoggerProvider, LoggingHandler+ from opentelemetry.sdk._logs.export import BatchLogRecordProcessor+ from opentelemetry.sdk.resources import Resource+ import logging++ resource = Resource(attributes={"service.name": "my-app"})++ logger_provider = LoggerProvider(resource=resource)+ set_logger_provider(logger_provider)++ exporter = OTLPLogExporter(+ endpoint="<ph_client_api_host>/otlp/v1/logs",+ headers={"Authorization": "Bearer <ph_project_token>"},+ )+ logger_provider.add_log_record_processor(BatchLogRecordProcessor(exporter))++ # Bridge standard library logging to OTel+ handler = LoggingHandler(logger_provider=logger_provider)+ logging.getLogger().addHandler(handler)+ logging.getLogger().setLevel(logging.INFO)+ `,+ },+ ]}+ />+ </>+ ),+ },+ {+ title: 'Send a log',+ badge: 'required',+ content: (+ <>+ <Markdown>+ Once configured, use the standard Python `logging` module. Logs are forwarded automatically:+ </Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'python',+ file: 'app.py',+ code: dedent`+ import logging+ from instrumentation import * # noqa: F401 – sets up the handler++ logger = logging.getLogger(__name__)++ logger.info("Request processed", extra={"request_id": "req_abc", "duration_ms": 42})+ logger.warning("High memory usage", extra={"usage_mb": 1024})+ logger.error("Database connection failed", extra={"host": "db.example.com"})+ `,+ },+ ]}+ />+ <Markdown>+ Logs appear in PostHog within a few seconds. Use the [Logs page](/logs) to search and filter by+ service name, severity, or any attribute you attach.+ </Markdown>+ </>+ ),+ },+ ]+}++export const PythonInstallation = createInstallation(getPythonSteps)diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex df37da57f448..254cf04eac74 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -5675,9 +5675,9 @@ snapshots:scenes-other-onboarding-post-onboarding-modal--llm-analytics--light:hash: v1.k794b7964.712c453e23887ba67256d238dd81efd93e679a850cf21260fea010eed0b77722.rUXbUP-denqKN65goF1ubUfWnfVibk0H8SAbO8YvruMscenes-other-onboarding-post-onboarding-modal--logs--dark:- hash: v1.k794b7964.9f9d3f5d5ddba99fb9546c2708031bcb0225344f6d73195689ee911f001a1ad3.lvIy1bYsSZEbNGIjOSCXsSslzmZPPc2v6LT9D-42AGY+ hash: v1.k794b7964.f9a6892e642aebe076aaeef5075dcef1d09cb7f820985443c66db143f60f11d2.fYzgtRRPAV6qgVvUpdwMQEw6Llm7nQRigyaOYSfaK8cscenes-other-onboarding-post-onboarding-modal--logs--light:- hash: v1.k794b7964.9c8d2e9260e23a10012fe6afed5c042a66d0a146ce4c3af7e9993d4b01af6305.Wb-jOQmQJljS9aO-eh4pmOHG4pZc0U-5EIupI1Fp0Zo+ hash: v1.k794b7964.7509d403d60f30d7c2572b30c1671f7312bc1a84f53287ddc412dec4542c5926.T_oJoHiZpaUM-pzyc_xTicoGoALna-sbDVpop0dB_Rkscenes-other-onboarding-post-onboarding-modal--product-analytics--dark:hash: v1.k794b7964.908a010434b289ed7cf876883429ef9534e1a63b82e4671f15f2174a19cd4678.RMcJStFpCU4fg-QMJW1rPOScHX9hYNtWrPNERZAYZK8scenes-other-onboarding-post-onboarding-modal--product-analytics--light:@@ -5703,9 +5703,9 @@ snapshots:scenes-other-onboarding-post-onboarding-modal--workflows--light:hash: v1.k794b7964.fe0bbdd94043036fa8a1133e6b99950d76a8f175a41ac3fe35989445c04d561a.VjP9Cyy5ilxplkCzZG8cHytn1yFwT6t2AqPWDXFO7TIscenes-other-onboarding-product-selection--base--dark:- hash: v1.k794b7964.2d1da384ec9d6f8958d90c6fdef830bdeff3552ce055b8ad6fdb141b28e72f7b.cxGaH_YXfVuLLcFC4MqEyFdHNnXcV2wTr8u0ar5jvFw+ hash: v1.k794b7964.5c094da11f501dd20ed0755a60c9b7b1bd55a70e469734201b8f9f220d6c06a6.e4fy-aJB70b-ULhvXkz_aFF8AaZx-0hHi1HfwK6qpmoscenes-other-onboarding-product-selection--base--light:- hash: v1.k794b7964.bea82502c0a95a569ef73194f914368ae78a83713bc95a766e69b349dc4a000f.-Co8sHXwpFtz86_VfOSMRREFI6rMpQvJMP-ComUyKsg+ hash: v1.k794b7964.ddca88d75ad2c3d020f72dd8cd470610851d84663542514a8930e43e1b9ca413.I9J8-blKK96ivpXDeJoyIM-kcUhbMHofr0qr6z2z8UMscenes-other-org-member-invites--current-user-is-admin--dark:hash: v1.k794b7964.241706aee199cb1495ed6b1c5055902f0d89e64095c444d9687041d5e5b44b6a.swMzsS85w-CrYfkS0f51lDm4-4fFOMeL1K01RJnNLHQscenes-other-org-member-invites--current-user-is-admin--light:diff --git a/frontend/src/lib/components/ProductSetup/productSetupRegistry.ts b/frontend/src/lib/components/ProductSetup/productSetupRegistry.tsindex e10a2b6f9771..bae9d9c6bc09 100644--- a/frontend/src/lib/components/ProductSetup/productSetupRegistry.ts+++ b/frontend/src/lib/components/ProductSetup/productSetupRegistry.ts@@ -570,7 +570,9 @@ export const PRODUCT_SETUP_REGISTRY: Partial<Record<ProductKey, ProductSetupConfdescription: 'Start sending logs from your application to PostHog.',taskType: 'setup',requiresManualCompletion: true,+ getUrl: () => urls.onboarding({ productKey: ProductKey.LOGS, stepKey: OnboardingStepKey.INSTALL }),docsUrl: 'https://posthog.com/docs/logs',+ targetSelector: '[data-attr="menu-item-logs"]',},{id: SetupTaskId.ViewFirstLogs,diff --git a/frontend/src/lib/components/SessionTimeline/timeline/items/eventDetails.tsx b/frontend/src/lib/components/SessionTimeline/timeline/items/eventDetails.tsxindex e6f1105f47f1..1aaf404a27cf 100644--- a/frontend/src/lib/components/SessionTimeline/timeline/items/eventDetails.tsx+++ b/frontend/src/lib/components/SessionTimeline/timeline/items/eventDetails.tsx@@ -182,7 +182,7 @@ export const LazyEventDetailsRenderer: React.FC<RendererProps<TimelineItem>> = (return () => {mounted = false}- }, [item.id, item.category, item.timestamp, sessionId])+ }, [item.id, item.category, item.timestamp, sessionId, item])if (loading) {return (diff --git a/frontend/src/scenes/experiments/ExperimentView/DistributionTable.tsx b/frontend/src/scenes/experiments/ExperimentView/DistributionTable.tsxindex 9481dd90f379..c151cda4e3f9 100644--- a/frontend/src/scenes/experiments/ExperimentView/DistributionTable.tsx+++ b/frontend/src/scenes/experiments/ExperimentView/DistributionTable.tsx@@ -45,7 +45,11 @@ export function DistributionModal(): JSX.Element {setVariants(experiment.feature_flag?.filters?.multivariate?.variants || [])setRolloutPercentage(experiment.feature_flag?.filters?.groups?.[0]?.rollout_percentage ?? 100)}- }, [isDistributionModalOpen, experiment.feature_flag?.filters?.multivariate?.variants])+ }, [+ isDistributionModalOpen,+ experiment.feature_flag?.filters?.multivariate?.variants,+ experiment.feature_flag?.filters?.groups,+ ])const handleClose = (): void => {closeDistributionModal()diff --git a/frontend/src/scenes/experiments/legacy/LegacyExperimentView.tsx b/frontend/src/scenes/experiments/legacy/LegacyExperimentView.tsxindex ccc4e2734bd8..b2ef7970f08a 100644--- a/frontend/src/scenes/experiments/legacy/LegacyExperimentView.tsx+++ b/frontend/src/scenes/experiments/legacy/LegacyExperimentView.tsx@@ -171,7 +171,7 @@ export function LegacyExperimentView({ tabId }: Pick<ExperimentSceneLogicProps,if (!experimentLoading && experiment) {refreshExperimentResults(false, 'page_load')}- }, [experimentLoading, experiment?.id])+ }, [experimentLoading, experiment?.id, experiment, refreshExperimentResults])return (<BindLogic logic={legacyExperimentLogic} props={legacyLogicProps}>diff --git a/frontend/src/scenes/onboarding/Onboarding.tsx b/frontend/src/scenes/onboarding/Onboarding.tsxindex 637c4c846218..fa21fd716d49 100644--- a/frontend/src/scenes/onboarding/Onboarding.tsx+++ b/frontend/src/scenes/onboarding/Onboarding.tsx@@ -37,6 +37,7 @@ import {LLMAnalyticsSDKInstructions,LLMAnalyticsSDKTagOverrides,} from './sdks/llm-analytics/LLMAnalyticsSDKInstructions'+import { LogsSDKInstructions } from './sdks/logs/LogsSDKInstructions'import { OnboardingInstallStep } from './sdks/OnboardingInstallStep'import {ProductAnalyticsSDKInstructions,@@ -416,6 +417,14 @@ const WorkflowsOnboarding = (): JSX.Element => {)}+const LogsOnboarding = (): JSX.Element => {+ return (+ <OnboardingWrapper>+ <OnboardingInstallStep sdkInstructionMap={LogsSDKInstructions} hideInstallationCheck />+ </OnboardingWrapper>+ )+}+const WorkflowsInstallHeader = (): JSX.Element => {const { wizardCommand, isCloudOrDev } = useWizardCommand()@@ -471,6 +480,7 @@ export const onboardingViews = {[ProductKey.ERROR_TRACKING]: ErrorTrackingOnboarding,[ProductKey.LLM_ANALYTICS]: LLMAnalyticsOnboarding,[ProductKey.WORKFLOWS]: WorkflowsOnboarding,+ [ProductKey.LOGS]: LogsOnboarding,}export function Onboarding(): JSX.Element | null {diff --git a/frontend/src/scenes/onboarding/onboardingLogic.tsx b/frontend/src/scenes/onboarding/onboardingLogic.tsxindex 9f508bc6a27d..7d3460d6a252 100644--- a/frontend/src/scenes/onboarding/onboardingLogic.tsx+++ b/frontend/src/scenes/onboarding/onboardingLogic.tsx@@ -76,6 +76,8 @@ export const getOnboardingCompleteRedirectUri = (productKey: ProductKey): stringreturn urls.llmAnalyticsDashboard()case ProductKey.WORKFLOWS:return urls.workflows()+ case ProductKey.LOGS:+ return urls.logs()default:return urls.default()}@@ -132,6 +134,9 @@ export const onboardingLogic = kea<onboardingLogicType>([setOnCompleteOnboardingRedirectUrl: (url: string | null) => ({ url }),skipOnboarding: true,setAwaitingPostOnboardingModal: (awaiting: boolean) => ({ awaiting }),+ setSessionSecondaryProductKeys: (keys: ProductKey[]) => ({ keys }),+ setFromProductKey: (key: ProductKey | null) => ({ key }),+ setResumeStep: (step: OnboardingStepKey | null) => ({ step }),}),reducers(() => ({isAwaitingPostOnboardingModal: [@@ -182,6 +187,24 @@ export const onboardingLogic = kea<onboardingLogicType>([setOnCompleteOnboardingRedirectUrl: (_, { url }) => url,},],+ sessionSecondaryProductKeys: [+ [] as ProductKey[],+ {+ setSessionSecondaryProductKeys: (_, { keys }) => keys,+ },+ ],+ fromProductKey: [+ null as ProductKey | null,+ {+ setFromProductKey: (_, { key }) => key,+ },+ ],+ resumeStep: [+ null as OnboardingStepKey | null,+ {+ setResumeStep: (_, { step }) => step,+ },+ ],})),selectors({breadcrumbs: [@@ -388,24 +411,76 @@ export const onboardingLogic = kea<onboardingLogicType>([goToNextStep: ({ numStepsToAdvance }) => {const currentStepIndex = values.allOnboardingSteps.findIndex((step) => getStepKey(step) === values.stepKey)const nextStep = values.allOnboardingSteps[currentStepIndex + (numStepsToAdvance || 1)]- if (nextStep) {+ const baseParams = { ...router.values.searchParams }++ // Divert into Logs install when leaving the primary product's Install step with+ // Logs selected as a secondary intent. Strip LOGS from `secondary` so that if the+ // user later returns to this step, the divert won't fire again (no ping-pong).+ // The primary's next-step key is captured as `resumeStep` so completion of the+ // Logs install can return the user to the correct point in the primary flow.+ if (+ values.stepKey === OnboardingStepKey.INSTALL &&+ values.productKey !== ProductKey.LOGS &&+ values.sessionSecondaryProductKeys.includes(ProductKey.LOGS)+ ) {+ const remainingSecondary = values.sessionSecondaryProductKeys.filter((k) => k !== ProductKey.LOGS)+ const resumeStepKey = nextStep ? getStepKey(nextStep) : nullreturn [- `/onboarding/${values.productKey}`,- { ...router.values.searchParams, step: getStepKey(nextStep) },+ urls.onboarding({+ productKey: ProductKey.LOGS,+ stepKey: OnboardingStepKey.INSTALL,+ secondary: remainingSecondary.length ? remainingSecondary : undefined,+ from: values.productKey ?? undefined,+ resumeStep: resumeStepKey ?? undefined,+ }),+ {},]}- return [`/onboarding/${values.productKey}`, router.values.searchParams]++ // Returning from a Logs divert: route to the original product at its captured+ // resume step. If no resume step was captured, the primary had no further steps+ // and completion is handled by the install step's NextButton (completeOnboarding).+ if (values.productKey === ProductKey.LOGS && values.fromProductKey && values.resumeStep && !nextStep) {+ return [+ urls.onboarding({+ productKey: values.fromProductKey,+ stepKey: values.resumeStep,+ secondary: values.sessionSecondaryProductKeys.length+ ? values.sessionSecondaryProductKeys+ : undefined,+ }),+ {},+ ]+ }++ if (nextStep) {+ return [`/onboarding/${values.productKey}`, { ...baseParams, step: getStepKey(nextStep) }]+ }+ return [`/onboarding/${values.productKey}`, baseParams]},goToPreviousStep: () => {const currentStepIndex = values.allOnboardingSteps.findIndex((step) => getStepKey(step) === values.stepKey)const previousStep = values.allOnboardingSteps[currentStepIndex - 1]+ const baseParams = { ...router.values.searchParams }if (previousStep) {+ return [`/onboarding/${values.productKey}`, { ...baseParams, step: getStepKey(previousStep) }]+ }+ // No previous step within this product: if we were diverted here from another+ // product's install step, navigate back to it. Strip LOGS from secondary so the+ // primary's "Continue" doesn't re-divert (back implies "I don't want this divert");+ // other secondary selections are preserved.+ if (values.fromProductKey) {+ const remainingSecondary = values.sessionSecondaryProductKeys.filter((k) => k !== ProductKey.LOGS)return [- `/onboarding/${values.productKey}`,- { ...router.values.searchParams, step: getStepKey(previousStep) },+ urls.onboarding({+ productKey: values.fromProductKey,+ stepKey: OnboardingStepKey.INSTALL,+ secondary: remainingSecondary.length ? remainingSecondary : undefined,+ }),+ {},]}- return [`/onboarding/${values.productKey}`, router.values.searchParams]+ return [`/onboarding/${values.productKey}`, baseParams]},updateCurrentTeamSuccess(val) {if (values.productKey && val.payload?.has_completed_onboarding_for?.[values.productKey]) {@@ -417,8 +492,8 @@ export const onboardingLogic = kea<onboardingLogicType>([},})),urlToAction(({ actions, values }) => ({- '/onboarding/:productKey': ({ productKey }, { success, upgraded, step }) => {- if (!productKey || !(productKey in availableOnboardingProducts)) {+ '/onboarding/:productKey': ({ productKey }, { success, upgraded, step, secondary, from, resumeStep }) => {+ if (!productKey || !Object.hasOwn(availableOnboardingProducts, productKey)) {return}@@ -431,6 +506,27 @@ export const onboardingLogic = kea<onboardingLogicType>([actions.setAllOnboardingSteps([])}+ // `secondary`/`from`/`resumeStep` are always sourced from the URL on every+ // route hit so navigating away from a URL without these params clears the+ // state — preventing leakage across separate onboardings in the same tab.+ // Defensive coercion: kea-router auto-coerces "true"/"42" to bool/number,+ // so we must guard against non-string values before splitting.+ const secondaryStr = typeof secondary === 'string' ? secondary : ''+ const secondaryKeys = secondaryStr+ ? (secondaryStr+ .split(',', 32)+ .filter((k: string) => Object.hasOwn(availableOnboardingProducts, k)) as ProductKey[])+ : []+ actions.setSessionSecondaryProductKeys(Array.from(new Set(secondaryKeys)))++ const fromValid =+ typeof from === 'string' && Object.hasOwn(availableOnboardingProducts, from) && from !== productKey+ actions.setFromProductKey(fromValid ? (from as ProductKey) : null)++ actions.setResumeStep(+ typeof resumeStep === 'string' && resumeStep ? (resumeStep as OnboardingStepKey) : null+ )+if (step) {// when loading specific steps, like plans, we need to make sure we have a billing response before we can continueconst stepsToWaitForBilling = [OnboardingStepKey.PLANS]diff --git a/frontend/src/scenes/onboarding/productRecommendations.ts b/frontend/src/scenes/onboarding/productRecommendations.tsindex 128d63c2fe5c..3abf116c2325 100644--- a/frontend/src/scenes/onboarding/productRecommendations.ts+++ b/frontend/src/scenes/onboarding/productRecommendations.ts@@ -32,10 +32,10 @@ export const USE_CASE_OPTIONS: ReadonlyArray<UseCaseDefinition> = [{key: 'fix_issues',title: 'Find and fix issues',- description: 'Watch session recordings and monitor errors to debug issues',+ description: 'Watch session recordings, monitor errors, and search application logs to debug issues',iconKey: 'IconWarning',iconColor: 'rgb(235 157 42)',- products: [ProductKey.SESSION_REPLAY, ProductKey.ERROR_TRACKING],+ products: [ProductKey.SESSION_REPLAY, ProductKey.ERROR_TRACKING, ProductKey.LOGS],},{key: 'launch_features',diff --git a/frontend/src/scenes/onboarding/productSelection/browsingHistoryMapping.ts b/frontend/src/scenes/onboarding/productSelection/browsingHistoryMapping.tsindex 474277b082df..04e6455c3811 100644--- a/frontend/src/scenes/onboarding/productSelection/browsingHistoryMapping.ts+++ b/frontend/src/scenes/onboarding/productSelection/browsingHistoryMapping.ts@@ -16,7 +16,7 @@ const PROD_INTEREST_TO_PRODUCT: Record<WebsiteBrowsingHistoryProdInterest, Produ'llm-analytics': ProductKey.LLM_ANALYTICS,workflows: ProductKey.WORKFLOWS,'revenue-analytics': null,- logs: null,+ logs: ProductKey.LOGS,endpoints: null,}diff --git a/frontend/src/scenes/onboarding/productSelection/productSelectionLogic.ts b/frontend/src/scenes/onboarding/productSelection/productSelectionLogic.tsindex 028ddf972a18..6f47af669aa9 100644--- a/frontend/src/scenes/onboarding/productSelection/productSelectionLogic.ts+++ b/frontend/src/scenes/onboarding/productSelection/productSelectionLogic.ts@@ -271,7 +271,12 @@ export const productSelectionLogic = kea<productSelectionLogicType>([? secondStepKey: OnboardingStepKey.INSTALL- router.actions.push(urls.onboarding({ productKey: values.firstProductOnboarding, stepKey }))+ const secondaryProducts = values.selectedProducts.filter(+ (k) => k !== values.firstProductOnboarding+ ) as string[]+ router.actions.push(+ urls.onboarding({ productKey: values.firstProductOnboarding, stepKey, secondary: secondaryProducts })+ )values.selectedProducts.forEach((productKey) => {actions.addProductIntent({diff --git a/frontend/src/scenes/onboarding/productSelection/variants/ProductCarousel.tsx b/frontend/src/scenes/onboarding/productSelection/variants/ProductCarousel.tsxindex 3c5020e80f4d..6953ea5f03d4 100644--- a/frontend/src/scenes/onboarding/productSelection/variants/ProductCarousel.tsx+++ b/frontend/src/scenes/onboarding/productSelection/variants/ProductCarousel.tsx@@ -18,6 +18,7 @@ import {GraphsHog,MailHog,MicrophoneHog,+ ReadingHog,RobotHog,SurprisedHog,} from 'lib/components/hedgehogs'@@ -42,6 +43,7 @@ const PRODUCT_HEDGEHOG: Partial<Record<string, React.ComponentType<{ className?:[ProductKey.ERROR_TRACKING]: DetectiveHog,[ProductKey.SURVEYS]: MicrophoneHog,[ProductKey.WORKFLOWS]: MailHog,+ [ProductKey.LOGS]: ReadingHog,}function getSocialProof(productKey: string): string | undefined {diff --git a/frontend/src/scenes/onboarding/productSelection/variants/legacy/LegacyProductSelection.tsx b/frontend/src/scenes/onboarding/productSelection/variants/legacy/LegacyProductSelection.tsxindex 6dfeb4e734e0..49135649d750 100644--- a/frontend/src/scenes/onboarding/productSelection/variants/legacy/LegacyProductSelection.tsx+++ b/frontend/src/scenes/onboarding/productSelection/variants/legacy/LegacyProductSelection.tsx@@ -168,7 +168,7 @@ function ProductSelectionStep(): JSX.Element {{recommendationSource === 'browsing_history' && <BrowsingHistoryBanner />}{/* Products list */}- <div className="grid grid-cols-[repeat(auto-fit,minmax(150px,190px))] gap-3 justify-center w-full">+ <div className="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 justify-center w-full">{availableRecommendedProducts.map((productKey) => (<ProductCardkey={productKey}diff --git a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/SDKInstructionsModal.tsx b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/SDKInstructionsModal.tsxindex 786b3639b86a..36b77cd257df 100644--- a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/SDKInstructionsModal.tsx+++ b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/SDKInstructionsModal.tsx@@ -17,6 +17,7 @@ interface SDKInstructionsModalProps {adblockResult: AdblockDetectionResultverifyingProperty?: stringverifyingName?: string+ hideInstallationCheck?: boolean}export function SDKInstructionsModal({@@ -27,15 +28,17 @@ export function SDKInstructionsModal({adblockResult,verifyingProperty = 'ingested_event',verifyingName = 'event',+ hideInstallationCheck = false,}: SDKInstructionsModalProps): JSX.Element {- const installationComplete = useInstallationComplete(verifyingProperty)+ const installationCompleteFromTeam = useInstallationComplete(verifyingProperty)+ const installationComplete = hideInstallationCheck || installationCompleteFromTeamconst sdkInstructions = sdkInstructionMap[sdk?.key as keyof typeof sdkInstructionMap] as| (() => JSX.Element)| undefinedreturn (- <LemonModal isOpen={isOpen} onClose={onClose} simple title="">+ <LemonModal isOpen={isOpen} onClose={onClose} simple title={sdk?.name ? `Install ${sdk.name}` : 'Install SDK'}>{!sdk?.key || !sdkInstructions ? (<SpinnerOverlay />) : (@@ -48,16 +51,20 @@ export function SDKInstructionsModal({<div className="flex-grow overflow-y-auto px-4 py-2"><SDKSnippet sdk={sdk} sdkInstructions={sdkInstructions} /></div>- {!installationComplete && (+ {!hideInstallationCheck && !installationComplete && (<div className="px-4 py-2"><AdblockWarning adblockResult={adblockResult} /></div>)}<footer className="sticky bottom-0 w-full bg-bg-light dark:bg-bg-depth rounded-b-sm p-2 flex justify-between items-center gap-2 px-4">- <RealtimeCheckIndicator- teamPropertyToVerify={verifyingProperty}- listeningForName={verifyingName}- />+ {!hideInstallationCheck ? (+ <RealtimeCheckIndicator+ teamPropertyToVerify={verifyingProperty}+ listeningForName={verifyingName}+ />+ ) : (+ <span />+ )}<NextButton installationComplete={installationComplete} /></footer></div>diff --git a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/index.tsx b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/index.tsxindex 5f89e3b27c2e..a5ee3ca8285e 100644--- a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/index.tsx+++ b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/index.tsx@@ -6,10 +6,12 @@ import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'import { isMobile } from 'lib/utils'import { teamLogic } from 'scenes/teamLogic'+import { ProductKey } from '~/queries/schema/schema-general'import { OnboardingStepKey, type SDK, SDKInstructionsMap, SDKTagOverrides } from '~/types'-import { OnboardingStepComponentType } from '../../onboardingLogic'+import { onboardingLogic, OnboardingStepComponentType } from '../../onboardingLogic'import { OnboardingStep } from '../../OnboardingStep'+import { availableOnboardingProducts } from '../../utils'import { useAdblockDetection } from '../hooks/useAdblockDetection'import { useInstallationComplete } from '../hooks/useInstallationComplete'import { AdblockWarning, RealtimeCheckIndicator } from '../RealtimeCheckIndicator'@@ -27,6 +29,8 @@ interface OnboardingInstallStepProps {sdkTagOverrides?: SDKTagOverrideslisteningForName?: stringteamPropertyToVerify?: string+ /** When true, the realtime check indicator is hidden and Continue is always enabled. */+ hideInstallationCheck?: booleanheader?: React.ReactNode}@@ -63,6 +67,7 @@ export const OnboardingInstallStep: OnboardingStepComponentType<OnboardingInstalsdkTagOverrides,listeningForName = 'event',teamPropertyToVerify = 'ingested_event',+ hideInstallationCheck = false,header,}) => {const { setAvailableSDKInstructionsMap, setSDKTagOverrides, selectSDK, setSearchTerm, setSelectedTag } =@@ -72,8 +77,14 @@ export const OnboardingInstallStep: OnboardingStepComponentType<OnboardingInstalconst [mobileHandoffDismissed, setMobileHandoffDismissed] = useState(false)const linkOpenedCapturedRef = useRef(false)const { currentTeam } = useValues(teamLogic)-- const installationComplete = useInstallationComplete(teamPropertyToVerify)+ const { productKey } = useValues(onboardingLogic)+ const productName = productKey+ ? availableOnboardingProducts[productKey as keyof typeof availableOnboardingProducts]?.name+ : undefined+ const installTitle = productName ? `Install ${productName}` : 'Install your SDK'++ const installationCompleteFromTeam = useInstallationComplete(teamPropertyToVerify)+ const installationComplete = hideInstallationCheck || installationCompleteFromTeamconst adblockResult = useAdblockDetection()const isSkipButtonExperiment = useFeatureFlag('ONBOARDING_SKIP_INSTALL_STEP', 'test')@@ -81,6 +92,11 @@ export const OnboardingInstallStep: OnboardingStepComponentType<OnboardingInstalconst isWizardTab = useFeatureFlag('ONBOARDING_WIZARD_PROMINENCE', 'wizard-tab')const isWizardOnly = useFeatureFlag('ONBOARDING_WIZARD_PROMINENCE', 'wizard-only')+ // Logs uses OpenTelemetry, not the PostHog JS wizard. When the Logs install step is+ // shown (either directly or after diversion from another product's wizard step),+ // skip all wizard variants and fall through to the control SDK-grid layout.+ const isLogsProduct = productKey === ProductKey.LOGS+// Double-gated: both the feature flag AND the client-side mobile check must// be true. The flag controls experiment enrollment (targeted to mobile// devices at the flag definition level in PostHog); isMobile() is the hard@@ -124,7 +140,7 @@ export const OnboardingInstallStep: OnboardingStepComponentType<OnboardingInstalsetInstructionsModalOpen(true)}- const isWizardVariant = isWizardHero || isWizardTab || isWizardOnly+ const isWizardVariant = (isWizardHero || isWizardTab || isWizardOnly) && !isLogsProductconst sdkGridProps: SDKGridProps = {filteredSDKs: filteredSDKs ?? [],@@ -162,12 +178,16 @@ export const OnboardingInstallStep: OnboardingStepComponentType<OnboardingInstaladblockResult={adblockResult}verifyingProperty={teamPropertyToVerify}verifyingName={listeningForName}+ hideInstallationCheck={hideInstallationCheck}/>)// Mobile users in the test arm get the handoff screen instead of the regular// variant dispatch. "Continue on this device" dismisses and falls through below.- if (showMobileHandoff) {+ // Logs onboarding uses OpenTelemetry, which has no `ingested_event` signal — the+ // mobile handoff would render a RealtimeCheckIndicator that never resolves and+ // leave Continue disabled forever, so we skip the handoff for Logs entirely.+ if (showMobileHandoff && !isLogsProduct) {return (<MobileInstallHandofflisteningForName={listeningForName}@@ -180,7 +200,7 @@ export const OnboardingInstallStep: OnboardingStepComponentType<OnboardingInstal}// Route to the appropriate experiment variant. WizardOnlyVariant renders its own SDKInstructionsModal.- if (isWizardHero) {+ if (isWizardHero && !isLogsProduct) {return (<><WizardHeroVariant {...variantProps} />@@ -189,7 +209,7 @@ export const OnboardingInstallStep: OnboardingStepComponentType<OnboardingInstal)}- if (isWizardTab) {+ if (isWizardTab && !isLogsProduct) {return (<><WizardTabVariant {...variantProps} />@@ -198,28 +218,30 @@ export const OnboardingInstallStep: OnboardingStepComponentType<OnboardingInstal)}- if (isWizardOnly) {+ if (isWizardOnly && !isLogsProduct) {return <WizardOnlyVariant {...variantProps} />}// Control: existing behavior — SDK grid without the wizard heroreturn (<OnboardingStep- title="Install"+ title={installTitle}stepKey={OnboardingStepKey.INSTALL}continueDisabledReason={!installationComplete ? 'Installation is not complete' : undefined}showSkip={showSkipAtBottom}actions={- <div className="pr-2">- <RealtimeCheckIndicator- teamPropertyToVerify={teamPropertyToVerify}- listeningForName={listeningForName}- />- </div>+ hideInstallationCheck ? undefined : (+ <div className="pr-2">+ <RealtimeCheckIndicator+ teamPropertyToVerify={teamPropertyToVerify}+ listeningForName={listeningForName}+ />+ </div>+ )}>{header}- {!installationComplete && <AdblockWarning adblockResult={adblockResult} />}+ {!hideInstallationCheck && !installationComplete && <AdblockWarning adblockResult={adblockResult} />}<div className="mt-6"><SDKGrid {...sdkGridProps} /></div>diff --git a/frontend/src/scenes/onboarding/sdks/logs/LogsSDKInstructions.tsx b/frontend/src/scenes/onboarding/sdks/logs/LogsSDKInstructions.tsxnew file mode 100644index 000000000000..bd3eed183446--- /dev/null+++ b/frontend/src/scenes/onboarding/sdks/logs/LogsSDKInstructions.tsx@@ -0,0 +1,48 @@+import {+ GoInstallation,+ JavaInstallation,+ NextJSInstallation,+ NodeJSInstallation,+ OpenTelemetryInstallation,+ PythonInstallation,+} from '@posthog/shared-onboarding/logs'++import { SDKInstructionsMap, SDKKey } from '~/types'++import { withOnboardingDocsWrapper } from '../shared/onboardingWrappers'++// Logs uses standard OTel packages — the posthog-wizard doesn't support OTLP+// log setup, so wizardIntegrationName is intentionally omitted for all wrappers.++const LogsNodeJSInstructionsWrapper = withOnboardingDocsWrapper({+ Installation: NodeJSInstallation,+})++const LogsNextJSInstructionsWrapper = withOnboardingDocsWrapper({+ Installation: NextJSInstallation,+})++const LogsPythonInstructionsWrapper = withOnboardingDocsWrapper({+ Installation: PythonInstallation,+})++const LogsGoInstructionsWrapper = withOnboardingDocsWrapper({+ Installation: GoInstallation,+})++const LogsJavaInstructionsWrapper = withOnboardingDocsWrapper({+ Installation: JavaInstallation,+})++const LogsOpenTelemetryInstructionsWrapper = withOnboardingDocsWrapper({+ Installation: OpenTelemetryInstallation,+})++export const LogsSDKInstructions: SDKInstructionsMap = {+ [SDKKey.NODE_JS]: LogsNodeJSInstructionsWrapper,+ [SDKKey.NEXT_JS]: LogsNextJSInstructionsWrapper,+ [SDKKey.PYTHON]: LogsPythonInstructionsWrapper,+ [SDKKey.GO]: LogsGoInstructionsWrapper,+ [SDKKey.JAVA]: LogsJavaInstructionsWrapper,+ [SDKKey.OPENTELEMETRY]: LogsOpenTelemetryInstructionsWrapper,+}diff --git a/frontend/src/scenes/onboarding/utils.tsx b/frontend/src/scenes/onboarding/utils.tsxindex e084b0138ba5..0cd21d101331 100644--- a/frontend/src/scenes/onboarding/utils.tsx+++ b/frontend/src/scenes/onboarding/utils.tsx@@ -8,6 +8,7 @@ import {IconDownload,IconGear,IconGraph,+ IconLive,IconLlmAnalytics,IconLogomark,IconMessage,@@ -37,6 +38,7 @@ import {GraphsHog,MailHog,MicrophoneHog,+ ReadingHog,RobotHog,} from 'lib/components/hedgehogs'import { Scene } from 'scenes/sceneTypes'@@ -55,6 +57,7 @@ const ICON_MAP: Record<string, React.ComponentType<{ className?: string; color?:IconDownload,IconGear,IconGraph,+ IconLive,IconLlmAnalytics,IconLogomark,IconMessage,@@ -293,4 +296,21 @@ export const availableOnboardingProducts: AvailableOnboardingProducts = {setupEffort: 'medium',socialProof: 'Used by 3K+ teams',},+ [ProductKey.LOGS]: {+ name: 'Logs',+ description: 'Search, filter, and monitor your application logs',+ userCentricDescription: 'Understand what your app is doing in real time',+ capabilities: ['Full-text log search', 'Structured log filtering', 'Alerting on log patterns'],+ valueProps: [+ { title: 'Full-text log search', problem: 'Find the exact log line that caused an incident' },+ { title: 'Structured filtering', problem: 'Drill into logs by service, severity, or any attribute' },+ { title: 'Log-based alerting', problem: 'Get notified the moment an error pattern appears' },+ ],+ hedgehog: ReadingHog,+ icon: 'IconLive',+ iconColor: 'var(--color-product-logs-light)',+ url: urls.logs(),+ scene: Scene.Logs,+ setupEffort: 'low',+ },}diff --git a/frontend/src/scenes/urls.ts b/frontend/src/scenes/urls.tsindex 6f12e68750f8..10559f543026 100644--- a/frontend/src/scenes/urls.ts+++ b/frontend/src/scenes/urls.ts@@ -170,11 +170,20 @@ export const urls = {productKey,stepKey,sdk,+ secondary,+ from,+ resumeStep,}: {campaign?: stringproductKey?: stringstepKey?: OnboardingStepKeysdk?: SDKKey+ /** Secondary product keys selected in this onboarding session (comma-joined in URL) */+ secondary?: string[]+ /** Product key the user navigated from (used for back navigation when diverted) */+ from?: string+ /** Step on the from-product to resume after a divert completes */+ resumeStep?: OnboardingStepKey} = {}): string => {if (campaign) {return `/onboarding/coupons/${campaign}`@@ -187,6 +196,15 @@ export const urls = {if (sdk) {params.set('sdk', sdk)}+ if (secondary?.length) {+ params.set('secondary', secondary.join(','))+ }+ if (from) {+ params.set('from', from)+ }+ if (resumeStep) {+ params.set('resumeStep', resumeStep)+ }const base = `/onboarding${productKey ? `/${productKey}` : ''}`const queryString = params.toString()diff --git a/frontend/src/types.ts b/frontend/src/types.tsindex eabbccd140a4..0dc387a8e1c4 100644--- a/frontend/src/types.ts+++ b/frontend/src/types.ts@@ -6396,7 +6396,8 @@ export type AvailableOnboardingProducts = Record<| ProductKey.WEB_ANALYTICS| ProductKey.ERROR_TRACKING| ProductKey.LLM_ANALYTICS- | ProductKey.WORKFLOWS,+ | ProductKey.WORKFLOWS+ | ProductKey.LOGS,OnboardingProduct>