ai-observability-langchain-python

ai-observability-langchain-python is a skill for Claude Code, Codex from Jwuthri/Tracely-ai. It costs 21 tokens per session (1,996 once invoked), scanned A, original, MIT.

An integration guide for sending activity from LangChain, a Python framework for building applications with language models, to PostHog AI Observability, a tool for examining AI usage.

In plain words
What is it for?
Use it to instrument existing LangChain applications, record model calls in PostHog, and configure the required packages, credentials, and environment variables.
Why use it?
It helps developers see each language-model interaction as part of a complete session and trace instead of isolated events.

Skill for Claude CodeCodex

About the project

Tracely is a CI/CD system for AI agents that turns failed production traces into replayable regression tests. Development teams use it to detect and group agent failures, run the resulting cases on pull requests, and block changes that reproduce those failures. The catalogue entries provide skills for operating this trace-based testing and observability workflow.

Jwuthri/Tracely-ai · 1,189 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/jwuthri/tracely-ai/ai-observability-langchain-python
Any agent
npx skills add Jwuthri/Tracely-ai --skill ai-observability-langchain-python
Clone the repo
git clone --depth 1 https://github.com/Jwuthri/Tracely-ai

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-observability-langchain-python

README.md
[![agentmods](https://agentmods.dev/badge/skills/jwuthri/tracely-ai/ai-observability-langchain-python.svg)](https://agentmods.dev/skills/jwuthri/tracely-ai/ai-observability-langchain-python)
Your own site
<a href="https://agentmods.dev/skills/jwuthri/tracely-ai/ai-observability-langchain-python"><img src="https://agentmods.dev/badge/skills/jwuthri/tracely-ai/ai-observability-langchain-python.svg" alt="Measured on agentmods" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,996 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00021 $0.01996
Opus 5 $0.00010 $0.00998
Sonnet 5 $0.00004 $0.00399
Haiku 4.5 $0.00002 $0.00200

Measured 5d ago against content hash 4d3fec79f9ed, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ai-observability-langchain-python scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/ai-observability-langchain-python/SKILL.md · 86 lines

How it starts

The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PostHog AI Observability for LangChain (Python)

Wire up PostHog's AI Observability so calls made through LangChain (Python) land in LLM Analytics as a full session → trace → span → generation tree — not just isolated $ai_generation events.

Prerequisite — vendor LLM SDK

This skill instruments the LLM calls the project already makes. It does not install the vendor SDK for you.

Check the project's manifest for an LLM package. The catalog is far wider than the obvious providers — 68 variants covering agent frameworks (openai-agents, claude-agent-sdk, LangGraph, CrewAI, Mastra, …) and OpenAI-compatible gateways (Groq, OpenRouter, Together, Ollama, …), which an app reaches through the openai package plus a baseURL override. 1-begin.md carries the ordered decision rules; follow them rather than matching on the first familiar package name. If no LLM SDK is present, switch to the manual-capture variant — it posts $ai_generation events directly and works standalone.

Everything else this skill needs — PostHog credentials, instrumentation packages, env vars — the skill installs and configures itself. It does not require a pre-existing posthog.init(...). If one is already there, reuse its env-var names in 3-instrument.md; if not, that step sets fresh values via set_env_values.

Steps

Read every referenced file before editing. Then work through them in order:

  1. Begin — see references/1-begin.md. Pick the variant with the ordered rules (framework before provider, gateway base URL before the SDK it borrows), then read four facts from the code: the conversation, the user, the turn, and whether the app registers tools.
  2. Install — see references/2-install.md. Declare the variant's packages in the manifest — and only those. For providers and gateways that's the PostHog SDK alongside the vendor SDK, with no OpenTelemetry packages.
  3. Instrument — see references/3-instrument.md. Swap the vendor client for PostHog's wrapper, attach $ai_session_id, a per-turn posthog_trace_id, and the distinct id to every call, and capture tool runs as $ai_span events. This step is what turns isolated generations into a session tree.
  4. Verify — see references/4-verify.md. Describe a request the user can trigger, and grade what lands in PostHog — one session, grouped traces, right attribution — rather than what the diff contains.

Read the full file on GitHub · 86 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 86 lines · 21 tokens per session scan A 4d3fec79f9ed

Subscribe to this mod's changes

ai-observability-langchain-python is a skill published in the GitHub repository Jwuthri/Tracely-ai (1,189 stars, last pushed today), licensed MIT. It adds 21 tokens to every session and 1,996 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

ci-watchdog

Continuously monitor GitHub PR CI checks and automatically fix failures until all checks pass. USE THIS SKILL when: The user wants to "keep an eye on CI" or "wait for checks to pass" The user mentions monitoring PR status, CI status, or GitHub checks The user asks to watch a PR until it's ready or fix failing checks…

latitude-dev/latitude-llm · 155 tokens

golang-continuous-integration

GitHub Actions CI/CD pipeline configuration for Golang projects — workflow files for test, lint, SAST, coverage and vulnerability-scan jobs, Dependabot and Renovate config files, GoReleaser release pipelines, Docker build/push, repository security settings, and AI-driven PR review. Use when setting up or improving Go…

samber/cc-skills-golang · 181 tokens

code-style

Biome formatting, import style, strict TypeScript, naming (including React file names), or generated files.

latitude-dev/latitude-llm · 24 tokens

temps-plugin

Build external plugins for the Temps deployment platform. Use when the user wants to create, modify, or debug a Temps plugin binary — a standalone Rust process that communicates with Temps over a Unix domain socket. Also use when the user mentions "temps plugin", "external plugin", "plugin binary", "plugin for temps"…

gotempsh/temps · 120 tokens

deploy-to-temps

Deploy applications to the Temps platform with automatic framework detection, Dockerfile generation, and container orchestration. Supports Next.js, Vite, React, Node.js, Python, Go, Rust, Java, and C# applications. Use when the user wants to: (1) Deploy their app to Temps, (2) Set up CI/CD with Temps, (3) Configure…

gotempsh/temps · 141 tokens

upgrading-golang

Upgrades Go version across the entire Chainloop codebase including source files, Docker images, CI/CD workflows, and documentation. Use when the user mentions upgrading Go, golang version, or updating Go compiler version.

chainloop-dev/chainloop · 48 tokens