trulens-instrumentation
Skill by truera
Guides developers through instrumenting LLM apps with TruLens OTEL-based tracing. It covers setup, framework wrappers, and custom spans for evaluation and debugging.
Install trulens-instrumentation
Built from the published package, never by AI.
git clone --depth 1 https://github.com/truera/trulens /tmp/trulens && mkdir -p ~/.claude/skills && cp -r /tmp/trulens/src/core/trulens/.agents/skills/trulens-instrumentation ~/.claude/skills/trulens-instrumentationRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install trulens-instrumentation in Claude Code
git clone --depth 1 https://github.com/truera/trulens /tmp/trulens && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/trulens/src/core/trulens/.agents/skills/trulens-instrumentation ~/.gemini/antigravity-cli/skills/trulens-instrumentationAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install trulens-instrumentation in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
The trulens-instrumentation skill guides an assistant through instrumenting an LLM application with TruLens OTEL-based tracing. It covers initial TruSession setup and choosing a framework wrapper such as TruChain, TruGraph, TruLlama or TruLlamaWorkflow. It also covers adding custom spans with the @instrument() decorator, instrument_method() for third-party classes, and lambda-based attribute extraction.
The traces it captures are meant for evaluation with feedback functions and for debugging in the TruLens dashboard. The skill explains which span types suit each step, such as RETRIEVAL, GENERATION, TOOL, AGENT and RECORD_ROOT. The source is written for developers building RAG, agent or custom LLM apps who want clearer traces or fixes for missing attributes that break evaluations.
Written from the project's SKILL.md and checked against it.
What it can do
- Session setupInitialize a TruSession and choose an instrumentation approach.
- Framework wrappersWrap LangChain, LangGraph, LlamaIndex and custom apps with TruChain, TruGraph, TruLlama or TruApp.
- Custom spansAdd @instrument() decorators with span types and attributes to your functions.
- Third-party classesInstrument external classes you cannot edit with instrument_method().
- Span type guidanceMap query, retrieval, generation, tool and agent steps to matching span types.
- Lambda extractionPull complex return values into span attributes with a lambda expression.
- Deep Agents supportInstrument LangChain Deep Agents, which are built on LangGraph, using TruGraph.
- Feedback selector rulesExplain why TruGraph creates RECORD_ROOT spans needed for on_input and on_output.
What you need
- Python with pip
- trulens package
- trulens-apps-langchain for LangChain or LangGraph
- trulens-apps-llamaindex for LlamaIndex
Try asking
- Instrument my LangChain chain with TruChain and add tracing
- Add @instrument() spans to my retrieve and generate functions
- Wrap my LangGraph agent with TruGraph so feedback works
Good to know
- Manual AGENT spans do not work with .on_input() and .on_output() shortcuts, which need RECORD_ROOT spans.
- The source ends mid-section in the span types and feedback selectors part, so that guidance is incomplete.
- Framework wrappers need the matching trulens-apps package installed.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: src/core/trulens/.agents/skills/trulens-instrumentation/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to trulens-instrumentation
All alternatives →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
Compare with agent-reproduce-align, google_contacts or m06-error-handling
trulens-instrumentation: common questions
Which frameworks does this skill cover?
The source covers LangChain, LangGraph and LlamaIndex wrappers, plus custom apps through TruApp. Deep Agents built on LangGraph are covered through TruGraph.
Why use TruGraph instead of TruApp with @instrument?
The source says TruGraph captures all LangGraph nodes and creates the RECORD_ROOT spans needed for the .on_input() and .on_output() shortcuts.
Does it work with custom Python apps?
Yes. The source shows @instrument() on methods of a custom class, wrapped with TruApp, and instrument_method() for classes you cannot modify.
How do I install trulens-instrumentation?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is trulens-instrumentation free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is trulens-instrumentation safe to use?
It scores 81 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to trulens-instrumentation?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
