docs(llma): migrate onboarding docs to OpenTelemetry auto-instrumentation#53668
docs(llma): migrate onboarding docs to OpenTelemetry auto-instrumentation#53668richardsolomou wants to merge 9 commits intomasterfrom
Conversation
…tion Replace PostHog SDK wrapper approach with standard OpenTelemetry auto-instrumentation across 22 provider onboarding guides. Each doc now follows a 3-step pattern: install OTel deps, set up tracing, call the provider with the native SDK.
- Remove user.id from Vercel AI resource (posthog_distinct_id in experimental_telemetry is the established mechanism for that SDK) - Normalize service.name to 'my-app' in Vercel AI doc - Add anonymous events Blockquote to langchain, langgraph, llamaindex - Add Node tab to OpenAI embeddings step
|
…smolagents, pydantic-ai docs to OTel
|
Docs from this PR will be published at posthog.com
Preview will be ready in ~10 minutes. Click Preview link above to access docs at |
Problem
The in-app LLM analytics onboarding docs currently show PostHog SDK wrappers (
posthog.ai.openai,@posthog/ai) as the primary integration method. We're moving toward standard OpenTelemetry auto-instrumentation as the recommended approach, keeping the wrappers available as a last resort for users who need them.Changes
Migrates 28 provider onboarding guides from PostHog SDK wrapper approach to OpenTelemetry auto-instrumentation. Each migrated doc follows a consistent 3-step pattern:
TracerProviderwithOTLPSpanExporter(Python) orPostHogTraceExporter(Node)posthog_parametersUser identification uses the
posthog.distinct_idresource attribute; custom properties likefooandconversation_iddemonstrate the passthrough behavior.Providers migrated (21 original + 7 more):
@mastra/posthogexporter — Mastra's native integration since there's no mature OTel path yet)Kept as-is: google (no Node.js OTel instrumentation for
@google/genai), aws-bedrock (already OTel), crewai, litellm, dspy, openai-agents, manualMigration callout: Every migrated doc has a callout at the top linking to the full Node.js and Python examples on GitHub (current
main/master), plus legacy wrapper examples pinned to the last commit before the migration. This helps both new users (who see the recommended OTel path) and existing users (who can find the old wrapper examples they're already using).Manual capture doc: Split into multiple steps so it can have a useful table of contents (Capture LLM events manually → Event properties → Verify traces and generations).
Removed: "No proxy" callouts from all migrated docs — they made sense when wrapping SDK clients but don't apply to standard OTel tracing.
How did you test this code?
Agent-authored PR. Manually verified:
pnpm --filter=@posthog/frontend formatruns cleanly)No runtime tests since these are in-app onboarding content (static TSX returning step definitions).
Publish to changelog?
No
Docs update
This IS the docs update. Companion PR: PostHog/posthog.com#16236 (updates TOC frontmatter in posthog.com).
🤖 LLM context
Co-authored with Claude Code. Related PRs: