instrument-llm-analytics

Official

Instrument LLM analytics to track AI generations.

AuthorPostHog
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Instrumentation of LLM calls to automatically generate and push $ai_generation events to PostHog, enabling observability of model usage, latency, tokens, and costs across your stack.

Core Features & Use Cases

  • Auto-instrument LLM calls across providers and frameworks using OpenTelemetry and PostHog instrumentation to generate $ai_generation events with model, provider, input/output tokens, latency, and cost data.
  • Link events to users and traces, enabling per-user analytics, traces, spans, and sessions for debugging and performance optimization.
  • Quick start guidance for installation, environment configuration, and minimal code changes to instrument LLM calls without restructuring your architecture.
  • Supports multiple providers and frameworks as listed in the SKILL.md to ensure broad coverage.

Quick Start

Configure your project to enable PostHog LLM analytics instrumentation, install the required SDKs, and instrument your LLM calls with minimal code changes.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: instrument-llm-analytics
Download link: https://github.com/PostHog/skills/archive/main.zip#instrument-llm-analytics

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.