P
landing- Words
- 1,462
- Reading time
- 7 min
- Last crawled
- 2026-11-25
- Cited by
- 13 of their pages
- Language
- EN
cat posthog.com/ai-observability.md
   ## Observe and fix AI in production "Show me LLM costs this week broken down by model" ## What does it do? AI Observability captures the full context of each trace and connects it to other PostHog products (like Session Replay). Evals score your live traffic and anomaly alerts tell you when things are not normal, so regressions in tool calling, response quality, or latency automatically turn into signals. ## Who is it for? Role Use cases AI Engineers Debug traces span by span and set up evals to catch quality regressions Product Engineers Tie failed generations and latency spikes back to the users who hit them PMs See which AI features get used – and whether using them changes retention Finance & leadership Attribute token spend to models, features, and individual customers Support Engineers Read the exact conversation behind a ticket, then watch the session it happened in  ## How do I use it? ### Query LLM traces from your editor Check LLM costs, monitor errors, and analyze model performance from Cursor, Claude Code, VS Code, or any MCP-compatible agent. Check costs before and after deploys Compare LLM spend across periods to spot unexpected jumps before they compound. Monitor errors Surface failing LLM calls so your agent can flag or fix them immediately. Compare models Evaluate cost, latency, and token usage across models to pick the right one per feature. Turn failure modes into evals Let your agent explore traces, spot recurring failure modes, and create evaluations that catch them. ```npx @posthog/wizard mcp add``` Supports Next.js, React, Python, and ## Key features  ### Trace every conversation end to end Debug entire conversations, not just individual calls. Every trace is a timeline of its generations and spans, with the person, total cost, and total latency attached. Trace timeline A waterfall of every span and generation, with latency and cost at each step Full conversation context The exact input and output of every call, including multi-turn history and tool calls Tokens and cost Token counts per call, with cost calculated automatically from model pricing Integrated session recordings Jump from a trace to the session recording and watch what the response did in your UI Privacy mode Optionally exclude sensitive data from being captured ## AI prompts Ask PostHog AI to check what your LLM calls cost, dig into traces, and compare models. Works in [PostHog AI](https://posthog.com/ai) (in-app chat), [PostHog Desktop](https://posthog.com/desktop) (our AI code editor), and in your product editor (using the MCP). Click a prompt to copy it, then paste it into your agent. ### Costsget-llm-total-costs-for-project ### Find tracesquery-llm-traces-list ### Errors ### Compare models ## Works with other PostHog tools Use AI Observability with these other PostHog apps to maximize shareholder value. - [**Product Analytics**Correlate AI usage with user behavior and business metrics](https://posthog.com/product-analytics)- [**Error Tracking**Failed LLM calls become issues you can triage, assign, and resolve](https://posthog.com/error-tracking)- [**Session Replay**Watch how users interact with AI features in real sessions](https://posthog.com/session-replay)- [**Feature Flags**Roll out AI features gradually and switch models without a deploy](https://posthog.com/feature-flags)- [**Experiments**A/B test prompts and models, measured on statistically significant results](https://posthog.com/experiments) ## Feature comparison Langfuse LangSmith Braintrust **Generation tracking** ✓ ✓ ✓ ✓ **Latency tracking** Track response times and identify slow prompts, models, and workflow steps ✓ ✓ ✓ ✓ **Cost tracking** Includes cost per user and broken down by provider, models ✓ ✓ ✓ ✓ **Trace visualization** View complete request traces across prompts, model calls, tools, and workflows ✓ ✓ ✓ ✓ **Token tracking** ✓ ✓ ✓ ✓ **Prompt playground** Interactive testing environment for prompts and models ✓ ✓ ✓ ✓ **Prompt evaluations** Online LLM-as-a-Judge evaluations for measuring AI output quality ✓ ✓ ✓ ✓ **Alerting** ✓ ✓ ✓ ✓ **Anomaly detection** Alerts that learn what normal looks like for cost, latency, and errors – no fixed thresholds to tune ✓ ✗ ✗ ✗ **Error tracking** Grouped error tracking for LLM applications ✓ ✓ ✓ ✓ **System prompts** Create and manage system prompts from the PostHog UI ✓ ✓ ✓ ✓ **Clustering** Automatic grouping of similar traces and outputs ✓ ✓ ✓ ✓ **Trace summarization** AI-generated summaries for quick understanding ✓ ✓ ✓ ✓ **LLM translation** Translation of non-English LLM traces to English ✓ ✗ ✗ Partial **Sentiment classification** Automatically classify user messages as positive, neutral, or negative ✓ Partial Partial ✓ **Privacy mode** Mask prompts and responses before they are stored ✓ ✓ ✓ ✓ **Agent/multi-step tracing** Understand complex agent and tool-calling workflows ✓ ✓ ✓ ✓ **Prompt management** Create, version, and manage prompts ✓ ✓ ✓ ✓ **Evaluation datasets** Create datasets for experimentation and benchmarking outputs ✓ ✓ ✓ ✓ **Human annotation/review** Review and label model outputs manually ✓ ✓ ✓ ✓ **User feedback** Capture ratings and comments from users on AI responses Beta ✓ ✓ ✓ **Agent reports & pull requests** Agents investigate eval results and anomalies, then file reports you can turn into PRs in one click ✓ ✗ Beta ✗ **AI gateway/proxy** Route LLM requests through a gateway for caching, rate limits, fallbacks, and observability ✗ ✗ ✗ ✓ Tracing Trace requests across prompts, model calls, tools, and workflows **Hierarchical traces** Nested spans showing the full call flow ✓ ✓ ✓ ✓ **Custom spans** Instrument any operation as a span ✓ ✓ ✓ ✓ **Tool call tracking** Track function/tool calls in AI agents ✓ ✓ ✓ ✓ **RAG retrieval tracking** Monitor retrieval steps in RAG pipelines ✓ ✓ ✓ ✓ **Session grouping** Group traces into user sessions ✓ ✓ ✓ ✓ **OpenTelemetry support** Ingest traces via the OTel protocol ✓ ✓ ✓ ✓ **Async ingestion** Non-blocking trace collection ✓ ✓ ✓ ✓ **Multi-model support** Track calls across LLM providers ✓ ✓ ✓ ✓ **Session replay link** Jump from a trace to the user's session recording ✓ ✗ ✗ ✗ **User profile context** Connect traces to full user profiles with behavioral history ✓ Partial Partial ✗ **SQL queries on traces** Query trace data alongside product events ✓ Partial ✗ ✓ **Trace explorer UI** Dedicated interface for browsing and filtering traces ✓ ✓ ✓ ✓ Prompt management Create, version, deploy, and test prompts **Prompt versioning** Track changes to prompts over time ✓ ✓ ✓ ✓ **Template variables** Dynamic {{variables}} compiled at runtime ✓ ✓ ✓ ✓ **Prompt deployment API** Fetch the active prompt version via SDK ✓ ✓ ✓ ✓ **Version comparison** Side-by-side diff of prompt versions ✓ ✓ ✓ ✓ **Prompt configuration** Store model parameters and settings with each prompt version ✓ ✓ ✓ ✓ **Prompt labels** Tag prompts as production, staging, latest ✓ ✓ ✓ ✓ **Prompt playground** Test and compare prompts interactively ✓ ✓ ✓ ✓ **Composable prompts** Link and chain prompts together ✗ ✓ ✗ ✗ **MCP server for prompts** Manage prompts via AI coding agents ✓ ✓ ✓ ✓ **A/B test prompt versions** Split users between versions, measure cost, latency, and eval pass rate ✓ ✓ Partial ✗ Evaluations Score, review, and test LLM outputs **LLM-as-a-judge** Use models to score outputs automatically ✓ ✓ ✓ ✓ **Code evaluators** Custom scoring functions for automated eval ✓ ✓ ✓ ✓ **Annotation queues** Assign human reviewers to score outputs ✓ ✓ ✓ ✓ **Datasets** Curate sets of inputs and expected outputs ✓ ✓ ✓ ✓ **Experiment runs** Run evaluation pipelines across datasets ✓ ✓ ✓ ✓ **A/B experiments on product metrics** Statistical tests measuring impact on real user behavior ✓ ✗ ✗ ✗ Costs Track token usage, model costs, and spending trends **Token counting** Track input and output tokens per call ✓ ✓ ✓ ✓ **Cost calculation** Dollar cost per generation ✓ ✓ ✓ ✓ **Cost by model** Break down spending by model ✓ ✓ ✓ ✓ **Cost trends** Historical cost over time ✓ ✓ ✓ ✓ **Cost by custom tags** Break down spending by feature, environment, or any metadata you attach ✓ ✓ ✓ ✓ ## Questions? ### Answers There are a few ways you can get answers to specific questions about AI Observability. 1. [Check the docs](https://posthog.com/docs/ai-observability) We have an entire [Wizard & Docs TeamWizard & Docs Team](https://posthog.com/teams/wizard-and-docs) dedicated to docs gardening. 2. [Read the pocket guide](https://posthog.com/learn/ai-observability/pocket-guide) Follow a guided story that introduces AI Observability one concept at a time. 3. [Search the community forums](https://posthog.com/forum/t/ask-the-hogs?tag=ai-observability) 82 discussions about AI Observability, there's a good chance your question is already answered! 4. [Ask PostHog AI](#) It's an incredibly useful AI chat that understands the product, docs, community questions, our codebase, GitHub issues, and industry knowledge. 5. [Talk to a human](https://posthog.com/talk-to-a-human) Dedicated humans are standing by and ready to assist. Best for questions about volume pricing, terms, and sexy legal stuff. ## Get started – free No credit card required. You get the **first 100,000 events free every month,** then pricing starts at **$0.00035/event** and reduces with volume to **$0.00006/event**. ### Install with AI Run this command in your terminal or AI editor. ```npx -y @posthog/wizard@latest ai-observability``` Supports OpenAI, Anthropic, Google Gemini, and ### Install without AI Sign up for a free account and follow the install instructions for your stack. [Get started - free](https://us.posthog.com/signup)
