{"id":"pg_q4cmvb4hm1sx","property_id":"prp_rnvsunvhyy60","domain_id":"dom_bjihbbcjezvy","root_domain":"posthog.com","locale":"en","url":"https://posthog.com/ai-observability","url_hash":"22bf1c4987d184e1c5c2276744b54006838476dc2a06f4d3aa64c7c38fc65ed2","path":"/ai-observability","depth":1,"canonical_url":"https://posthog.com/ai-observability","canonical_page_id":null,"page_type":"landing","page_type_guess":"landing","state":"indexed","skip_reason":"budget","priority":"0.9","discovered_via":"sitemap","first_seen_at":"2026-08-27T09:02:49.784Z","last_seen_at":"2026-11-25T11:10:31.176Z","http_status":200,"content_hash":"e1d991a3bec6b64d36ede27eeb877b8ba7ed6fb40ee40c2636bf8944bf59a320","title":"AI Observability – LLM tracing, evals, and costs | PostHog","description":"LLM observability for AI products. Trace every generation, track cost and latency, score quality with evals, and alert on anomalies in PostHog.","author":null,"published_at":null,"modified_at":null,"word_count":1462,"reading_time_sec":399,"lang_detected":"en","images":[],"links_out":null,"markdown_source":"readability","refresh_interval":"monthly","last_fetched_at":"2026-11-25T11:10:08.792Z","next_refresh_at":"2026-12-25T11:10:08.792Z","runs_count":1,"changes_count":0,"last_changed_at":null,"fail_count":0,"last_error":null,"created_at":"2026-08-27T09:02:49.784Z","updated_at":"2026-08-27T09:02:49.784Z","inlinks":13,"inlinks_body":13,"outlinks":41,"outlinks_external":0,"anchor_terms":["AI Observability","Evaluations"],"template_score":"0.50000000000000000000","cash":"0.102175467190920835","cash_total":"3.738282210522576164","pagerank":"0.0221803468663313","is_orphan":false,"link_confirmed":true,"discovered_wave":0,"embedded_hash":null,"embedded_at":null,"domain_name":"PostHog","brand_color":"#a1b97a","domain_rank":485,"spam_score":9,"markdown":"![AI Observability screenshot](https://res.cloudinary.com/dmukukwp6/image/upload/screenshot_llm_analytics_light_a436da72f7)\n\n![AI Observability screenshot](https://res.cloudinary.com/dmukukwp6/image/upload/screenshot_llm_analytics_dark_d8f32c249b)\n\n![A hedgehog inspecting a trace with a magnifying glass](https://res.cloudinary.com/dmukukwp6/image/upload/pasted_image_2026_07_30_T02_00_13_105_Z_20a891ad6d)\n\n## Observe and fix AI in production\n\n\"Show me LLM costs this week broken down by model\"\n\n## What does it do?\n\nAI 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.\n\n## Who is it for?\n\nRole\n\nUse cases\n\nAI Engineers\n\nDebug traces span by span and set up evals to catch quality regressions\n\nProduct Engineers\n\nTie failed generations and latency spikes back to the users who hit them\n\nPMs\n\nSee which AI features get used – and whether using them changes retention\n\nFinance & leadership\n\nAttribute token spend to models, features, and individual customers\n\nSupport Engineers\n\nRead the exact conversation behind a ticket, then watch the session it happened in\n\n![A hedgehog inspecting a trace with a magnifying glass](https://res.cloudinary.com/dmukukwp6/image/upload/pasted_image_2026_07_30_T02_00_13_105_Z_20a891ad6d)\n\n## How do I use it?\n\n### Query LLM traces from your editor\n\nCheck LLM costs, monitor errors, and analyze model performance from Cursor, Claude Code, VS Code, or any MCP-compatible agent.\n\nCheck costs before and after deploys\n\nCompare LLM spend across periods to spot unexpected jumps before they compound.\n\nMonitor errors\n\nSurface failing LLM calls so your agent can flag or fix them immediately.\n\nCompare models\n\nEvaluate cost, latency, and token usage across models to pick the right one per feature.\n\nTurn failure modes into evals\n\nLet your agent explore traces, spot recurring failure modes, and create evaluations that catch them.\n\n```\nnpx @posthog/wizard mcp add\n```\n\nSupports Next.js, React, Python, and\n\n## Key features\n\n![An LLM trace with its timeline, tree, and generation detail](https://res.cloudinary.com/dmukukwp6/image/upload/trace_detail_2_e0a6a23865)\n\n### Trace every conversation end to end\n\nDebug 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.\n\nTrace timeline\n\nA waterfall of every span and generation, with latency and cost at each step\n\nFull conversation context\n\nThe exact input and output of every call, including multi-turn history and tool calls\n\nTokens and cost\n\nToken counts per call, with cost calculated automatically from model pricing\n\nIntegrated session recordings\n\nJump from a trace to the session recording and watch what the response did in your UI\n\nPrivacy mode\n\nOptionally exclude sensitive data from being captured\n\n## AI prompts\n\nAsk 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.\n\n### Costsget-llm-total-costs-for-project\n\n### Find tracesquery-llm-traces-list\n\n### Errors\n\n### Compare models\n\n## Works with other PostHog tools\n\nUse AI Observability with these other PostHog apps to maximize shareholder value.\n\n-   [**Product Analytics**Correlate AI usage with user behavior and business metrics](https://posthog.com/product-analytics)\n-   [**Error Tracking**Failed LLM calls become issues you can triage, assign, and resolve](https://posthog.com/error-tracking)\n-   [**Session Replay**Watch how users interact with AI features in real sessions](https://posthog.com/session-replay)\n-   [**Feature Flags**Roll out AI features gradually and switch models without a deploy](https://posthog.com/feature-flags)\n-   [**Experiments**A/B test prompts and models, measured on statistically significant results](https://posthog.com/experiments)\n\n## Feature comparison\n\nLangfuse\n\nLangSmith\n\nBraintrust\n\n**Generation tracking**\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Latency tracking**\n\nTrack response times and identify slow prompts, models, and workflow steps\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Cost tracking**\n\nIncludes cost per user and broken down by provider, models\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Trace visualization**\n\nView complete request traces across prompts, model calls, tools, and workflows\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Token tracking**\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Prompt playground**\n\nInteractive testing environment for prompts and models\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Prompt evaluations**\n\nOnline LLM-as-a-Judge evaluations for measuring AI output quality\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Alerting**\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Anomaly detection**\n\nAlerts that learn what normal looks like for cost, latency, and errors – no fixed thresholds to tune\n\n✓\n\n✗\n\n✗\n\n✗\n\n**Error tracking**\n\nGrouped error tracking for LLM applications\n\n✓\n\n✓\n\n✓\n\n✓\n\n**System prompts**\n\nCreate and manage system prompts from the PostHog UI\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Clustering**\n\nAutomatic grouping of similar traces and outputs\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Trace summarization**\n\nAI-generated summaries for quick understanding\n\n✓\n\n✓\n\n✓\n\n✓\n\n**LLM translation**\n\nTranslation of non-English LLM traces to English\n\n✓\n\n✗\n\n✗\n\nPartial\n\n**Sentiment classification**\n\nAutomatically classify user messages as positive, neutral, or negative\n\n✓\n\nPartial\n\nPartial\n\n✓\n\n**Privacy mode**\n\nMask prompts and responses before they are stored\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Agent/multi-step tracing**\n\nUnderstand complex agent and tool-calling workflows\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Prompt management**\n\nCreate, version, and manage prompts\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Evaluation datasets**\n\nCreate datasets for experimentation and benchmarking outputs\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Human annotation/review**\n\nReview and label model outputs manually\n\n✓\n\n✓\n\n✓\n\n✓\n\n**User feedback**\n\nCapture ratings and comments from users on AI responses\n\nBeta\n\n✓\n\n✓\n\n✓\n\n**Agent reports & pull requests**\n\nAgents investigate eval results and anomalies, then file reports you can turn into PRs in one click\n\n✓\n\n✗\n\nBeta\n\n✗\n\n**AI gateway/proxy**\n\nRoute LLM requests through a gateway for caching, rate limits, fallbacks, and observability\n\n✗\n\n✗\n\n✗\n\n✓\n\nTracing\n\nTrace requests across prompts, model calls, tools, and workflows\n\n**Hierarchical traces**\n\nNested spans showing the full call flow\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Custom spans**\n\nInstrument any operation as a span\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Tool call tracking**\n\nTrack function/tool calls in AI agents\n\n✓\n\n✓\n\n✓\n\n✓\n\n**RAG retrieval tracking**\n\nMonitor retrieval steps in RAG pipelines\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Session grouping**\n\nGroup traces into user sessions\n\n✓\n\n✓\n\n✓\n\n✓\n\n**OpenTelemetry support**\n\nIngest traces via the OTel protocol\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Async ingestion**\n\nNon-blocking trace collection\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Multi-model support**\n\nTrack calls across LLM providers\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Session replay link**\n\nJump from a trace to the user's session recording\n\n✓\n\n✗\n\n✗\n\n✗\n\n**User profile context**\n\nConnect traces to full user profiles with behavioral history\n\n✓\n\nPartial\n\nPartial\n\n✗\n\n**SQL queries on traces**\n\nQuery trace data alongside product events\n\n✓\n\nPartial\n\n✗\n\n✓\n\n**Trace explorer UI**\n\nDedicated interface for browsing and filtering traces\n\n✓\n\n✓\n\n✓\n\n✓\n\nPrompt management\n\nCreate, version, deploy, and test prompts\n\n**Prompt versioning**\n\nTrack changes to prompts over time\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Template variables**\n\nDynamic {{variables}} compiled at runtime\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Prompt deployment API**\n\nFetch the active prompt version via SDK\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Version comparison**\n\nSide-by-side diff of prompt versions\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Prompt configuration**\n\nStore model parameters and settings with each prompt version\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Prompt labels**\n\nTag prompts as production, staging, latest\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Prompt playground**\n\nTest and compare prompts interactively\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Composable prompts**\n\nLink and chain prompts together\n\n✗\n\n✓\n\n✗\n\n✗\n\n**MCP server for prompts**\n\nManage prompts via AI coding agents\n\n✓\n\n✓\n\n✓\n\n✓\n\n**A/B test prompt versions**\n\nSplit users between versions, measure cost, latency, and eval pass rate\n\n✓\n\n✓\n\nPartial\n\n✗\n\nEvaluations\n\nScore, review, and test LLM outputs\n\n**LLM-as-a-judge**\n\nUse models to score outputs automatically\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Code evaluators**\n\nCustom scoring functions for automated eval\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Annotation queues**\n\nAssign human reviewers to score outputs\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Datasets**\n\nCurate sets of inputs and expected outputs\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Experiment runs**\n\nRun evaluation pipelines across datasets\n\n✓\n\n✓\n\n✓\n\n✓\n\n**A/B experiments on product metrics**\n\nStatistical tests measuring impact on real user behavior\n\n✓\n\n✗\n\n✗\n\n✗\n\nCosts\n\nTrack token usage, model costs, and spending trends\n\n**Token counting**\n\nTrack input and output tokens per call\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Cost calculation**\n\nDollar cost per generation\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Cost by model**\n\nBreak down spending by model\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Cost trends**\n\nHistorical cost over time\n\n✓\n\n✓\n\n✓\n\n✓\n\n**Cost by custom tags**\n\nBreak down spending by feature, environment, or any metadata you attach\n\n✓\n\n✓\n\n✓\n\n✓\n\n## Questions?\n\n### Answers\n\nThere are a few ways you can get answers to specific questions about AI Observability.\n\n1.  [Check the docs](https://posthog.com/docs/ai-observability)\n    \n    We have an entire [![Wizard & Docs mini crest](https://res.cloudinary.com/dmukukwp6/image/upload/f_png,h_20,w_20,c_fill,g_auto,q_auto/docs_and_wizards_c5bcdfd8d7?_a=AXAH4nI0)Wizard & Docs Team![Wizard & Docs mini crest](https://res.cloudinary.com/dmukukwp6/image/upload/f_png,h_20,w_20,c_fill,g_auto,q_auto/docs_and_wizards_c5bcdfd8d7?_a=AXAH4nI0)Wizard & Docs Team](https://posthog.com/teams/wizard-and-docs) dedicated to docs gardening.\n    \n2.  [Read the pocket guide](https://posthog.com/learn/ai-observability/pocket-guide)\n    \n    Follow a guided story that introduces AI Observability one concept at a time.\n    \n3.  [Search the community forums](https://posthog.com/forum/t/ask-the-hogs?tag=ai-observability)\n    \n    82 discussions about AI Observability, there's a good chance your question is already answered!\n    \n4.  [Ask PostHog AI](#)\n    \n    It's an incredibly useful AI chat that understands the product, docs, community questions, our codebase, GitHub issues, and industry knowledge.\n    \n5.  [Talk to a human](https://posthog.com/talk-to-a-human)\n    \n    Dedicated humans are standing by and ready to assist. Best for questions about volume pricing, terms, and sexy legal stuff.\n    \n\n## Get started – free\n\nNo 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**.\n\n### Install with AI\n\nRun this command in your terminal or AI editor.\n\n```\nnpx -y @posthog/wizard@latest ai-observability\n```\n\nSupports OpenAI, Anthropic, Google Gemini, and\n\n### Install without AI\n\nSign up for a free account and follow the install instructions for your stack.\n\n[Get started - free](https://us.posthog.com/signup)","storage":{"htmlKey":"stealpage/html/posthog.com/pg_q4cmvb4hm1sx/run_thlev0_fe80h.html.gz","markdownKey":"stealpage/md/posthog.com/pg_q4cmvb4hm1sx/run_thlev0_fe80h.md.gz"},"facets":null,"assets":[{"kind":"image","src_url":"https://posthog.com/images/og/default.png","r2_key":null,"alt":null,"caption":null,"width":null,"height":null,"is_hero":true,"zone":"main"},{"kind":"image","src_url":"https://res.cloudinary.com/dmukukwp6/image/upload/w_1780,q_auto,f_auto/9000_hogzilla_359a450fb3.png","r2_key":null,"alt":"","caption":null,"width":1780,"height":868,"is_hero":false,"zone":"unknown"},{"kind":"image","src_url":"https://res.cloudinary.com/dmukukwp6/image/upload/w_2967,q_auto,f_auto/9000_monopoly_light_6614a8a5d5.jpg","r2_key":null,"alt":"","caption":null,"width":2967,"height":1463,"is_hero":false,"zone":"unknown"},{"kind":"image","src_url":"https://res.cloudinary.com/dmukukwp6/image/upload/w_1582,q_auto,f_auto/9000_monopoly_dark_26c85ccad8.jpg","r2_key":null,"alt":"","caption":null,"width":1582,"height":780,"is_hero":false,"zone":"unknown"},{"kind":"image","src_url":"https://res.cloudinary.com/dmukukwp6/image/upload/w_997,q_auto,f_auto/office_cc4ae8675f.png","r2_key":null,"alt":"","caption":null,"width":997,"height":858,"is_hero":false,"zone":"unknown"},{"kind":"image","src_url":"https://res.cloudinary.com/dmukukwp6/image/upload/w_800,q_auto,f_auto/9000_hedge_light_42c729131e.png","r2_key":null,"alt":"","caption":null,"width":1555,"height":1262,"is_hero":false,"zone":"unknown"},{"kind":"image","src_url":"https://res.cloudinary.com/dmukukwp6/image/upload/w_800,q_auto,f_auto/9000_hedge_dark_b36706e924.png","r2_key":null,"alt":"","caption":null,"width":1555,"height":1262,"is_hero":false,"zone":"unknown"},{"kind":"image","src_url":"https://res.cloudinary.com/dmukukwp6/image/upload/demo_light_2008b30494.png","r2_key":null,"alt":"","caption":"Demo","width":62,"height":43,"is_hero":false,"zone":"nav"},{"kind":"image","src_url":"https://res.cloudinary.com/dmukukwp6/image/upload/demo_dark_6f25a1ecb2.png","r2_key":null,"alt":"","caption":"Demo","width":62,"height":43,"is_hero":false,"zone":"nav"},{"kind":"image","src_url":"https://res.cloudinary.com/dmukukwp6/image/upload/screenshot_llm_analytics_light_a436da72f7","r2_key":null,"alt":"AI Observability screenshot","caption":null,"width":null,"height":null,"is_hero":false,"zone":"main"},{"kind":"image","src_url":"https://res.cloudinary.com/dmukukwp6/image/upload/screenshot_llm_analytics_dark_d8f32c249b","r2_key":null,"alt":"AI Observability screenshot","caption":null,"width":null,"height":null,"is_hero":false,"zone":"main"},{"kind":"image","src_url":"https://res.cloudinary.com/dmukukwp6/image/upload/pasted_image_2026_07_30_T02_00_13_105_Z_20a891ad6d","r2_key":null,"alt":"A hedgehog inspecting a trace with a magnifying glass","caption":null,"width":null,"height":null,"is_hero":false,"zone":"main"},{"kind":"image","src_url":"https://res.cloudinary.com/dmukukwp6/image/upload/mcp_example_light_cf355dbe0d","r2_key":null,"alt":null,"caption":null,"width":null,"height":null,"is_hero":false,"zone":"main"},{"kind":"image","src_url":"https://res.cloudinary.com/dmukukwp6/image/upload/mcp_example_dark_c535f2d8b4","r2_key":null,"alt":null,"caption":null,"width":null,"height":null,"is_hero":false,"zone":"main"},{"kind":"image","src_url":"https://res.cloudinary.com/dmukukwp6/image/upload/trace_detail_2_e0a6a23865","r2_key":null,"alt":"An LLM trace with its timeline, tree, and generation detail","caption":null,"width":null,"height":null,"is_hero":false,"zone":"main"},{"kind":"image","src_url":"https://res.cloudinary.com/dmukukwp6/image/upload/f_png,h_20,w_20,c_fill,g_auto,q_auto/docs_and_wizards_c5bcdfd8d7?_a=AXAH4nI0","r2_key":null,"alt":"Wizard & Docs mini crest","caption":null,"width":null,"height":null,"is_hero":false,"zone":"main"},{"kind":"image","src_url":"https://res.cloudinary.com/dmukukwp6/image/upload/v1776974865/llm_2c1ecc7365.png","r2_key":null,"alt":"AI Observability team crest","caption":null,"width":null,"height":null,"is_hero":false,"zone":"main"}],"shots":[{"viewport":"mobile","width":390,"height":844,"r2_key":"stealpage/shots/posthog.com/pg_q4cmvb4hm1sx/run_thlev0_fe80h-mobile.png","phash":"b03334a283e6090f","visual_delta":null,"captured_at":"2026-11-25T11:10:15.393Z"},{"viewport":"desktop","width":1440,"height":900,"r2_key":"stealpage/shots/posthog.com/pg_q4cmvb4hm1sx/run_thlev0_fe80h-desktop.png","phash":"0323272721232019","visual_delta":null,"captured_at":"2026-11-25T11:10:14.885Z"}],"history":[{"id":"run_thlev0_fe80h","started_at":"2026-11-25T11:10:08.787Z","http_status":200,"fetcher":"direct","changed":false,"diff":null,"word_count":1462}],"citedBy":[{"id":"pg_5phwzcecs9tj","url":"https://posthog.com/web-analytics","title":"Web Analytics – Privacy-friendly website analytics | PostHog","anchors":["AI Observability"],"zone":"main"},{"id":"pg_ros_uzqbuuau","url":"https://posthog.com/session-replay","title":"Session Replay – Record and watch user sessions | PostHog","anchors":["AI Observability"],"zone":"main"},{"id":"pg_gr_3sa8sozut","url":"https://posthog.com/products","title":"Products – PostHog","anchors":["Evaluations","AI Observability"],"zone":"main"},{"id":"pg_qyahn5mzpueb","url":"https://posthog.com/surveys","title":"Surveys – Collect product feedback with PostHog","anchors":["AI Observability"],"zone":"main"},{"id":"pg_wgkvlqtxi9v_","url":"https://posthog.com/error-tracking","title":"Error Tracking – Error monitoring and alerts | PostHog","anchors":["AI Observability"],"zone":"main"},{"id":"pg_tgqauszyuclq","url":"https://posthog.com/self-driving","title":"Self-driving – Proactive fixes from product data | PostHog","anchors":["AI Observability"],"zone":"main"},{"id":"pg_r252fllprodd","url":"https://posthog.com/","title":"PostHog – Your product’s context layer","anchors":["AI Observability"],"zone":"main"},{"id":"pg_gmb93uoz0py8","url":"https://posthog.com/feature-flags","title":"Feature Flags – Ship safely and control rollouts with PostHog","anchors":["AI Observability"],"zone":"main"},{"id":"pg_h3o8ejrq0bzn","url":"https://posthog.com/workflows","title":"Workflows – Automate emails and messages from user behavior","anchors":["AI Observability"],"zone":"main"}]}