langsmith-tracing
LangSmith tracing and debugging setup for LLM applications. Configure observability, capture traces, and enable debugging for LangChain/LangGraph agents.
Best use case
langsmith-tracing is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
LangSmith tracing and debugging setup for LLM applications. Configure observability, capture traces, and enable debugging for LangChain/LangGraph agents.
Teams using langsmith-tracing should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/langsmith-tracing/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How langsmith-tracing Compares
| Feature / Agent | langsmith-tracing | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
LangSmith tracing and debugging setup for LLM applications. Configure observability, capture traces, and enable debugging for LangChain/LangGraph agents.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# langsmith-tracing
Configure LangSmith observability and tracing for LLM applications built with LangChain and LangGraph frameworks.
## Overview
LangSmith is the managed observability suite by LangChain that provides:
- Dashboards and alerting for LLM applications
- Human-in-the-loop evaluation capabilities
- Deep LangChain/LangGraph integration
- Run Tree model for nested traces
- MCP connectivity to Claude, VSCode
## Capabilities
### Core Tracing Setup
- Initialize LangSmith client and API configuration
- Configure project/workspace settings
- Set up trace collection and sampling
- Enable debug logging for agent execution
### Integration Patterns
- LangChain chain tracing with automatic instrumentation
- LangGraph workflow state tracking
- Custom span creation for non-LangChain code
- Parent-child trace relationships
### Debugging Features
- Fetch execution traces for analysis
- Query run history and metadata
- Export traces for offline analysis
- Compare runs across different versions
## Usage
### Environment Setup
```bash
# Set required environment variables
export LANGCHAIN_TRACING_V2=true
export LANGCHAIN_API_KEY=<your-api-key>
export LANGCHAIN_PROJECT=<project-name>
```
### Python Integration
```python
from langsmith import Client, traceable
from langchain.callbacks.tracers import LangChainTracer
# Initialize client
client = Client()
# Use @traceable decorator for custom functions
@traceable(name="custom_operation")
def my_function(input_data):
# Your logic here
return result
# Initialize tracer for LangChain
tracer = LangChainTracer(project_name="my-project")
# Use with LangChain chains
chain.invoke(input, config={"callbacks": [tracer]})
```
### Trace Retrieval
```python
# Fetch traces from LangSmith
runs = client.list_runs(
project_name="my-project",
start_time=datetime.now() - timedelta(hours=24),
execution_order=1, # Root runs only
error=False, # Successful runs only
)
for run in runs:
print(f"Run ID: {run.id}")
print(f"Latency: {run.latency_p99}")
print(f"Tokens: {run.total_tokens}")
```
## Task Definition
When used in a babysitter process, this skill produces:
```javascript
const langsmithTracingTask = defineTask({
name: 'langsmith-tracing-setup',
description: 'Configure LangSmith tracing for the application',
inputs: {
projectName: { type: 'string', required: true },
apiKeyEnvVar: { type: 'string', default: 'LANGCHAIN_API_KEY' },
samplingRate: { type: 'number', default: 1.0 },
enableDebug: { type: 'boolean', default: false }
},
outputs: {
configured: { type: 'boolean' },
projectUrl: { type: 'string' },
artifacts: { type: 'array' }
},
async run(inputs, taskCtx) {
return {
kind: 'skill',
title: `Configure LangSmith tracing for ${inputs.projectName}`,
skill: {
name: 'langsmith-tracing',
context: {
projectName: inputs.projectName,
apiKeyEnvVar: inputs.apiKeyEnvVar,
samplingRate: inputs.samplingRate,
enableDebug: inputs.enableDebug,
instructions: [
'Verify LangSmith API credentials are available',
'Create or validate project configuration',
'Set up tracing instrumentation in codebase',
'Configure sampling rate and debug settings',
'Verify traces are being captured correctly'
]
}
},
io: {
inputJsonPath: `tasks/${taskCtx.effectId}/input.json`,
outputJsonPath: `tasks/${taskCtx.effectId}/result.json`
}
};
}
});
```
## Applicable Processes
- llm-observability-monitoring
- agent-evaluation-framework
- react-agent-implementation
- conversation-quality-testing
- regression-testing-agent
## External Dependencies
- LangSmith account and API key
- LangChain Python library
- langsmith Python package
## References
- [LangSmith Documentation](https://docs.langchain.com/langsmith/observability)
- [LangSmith Fetch Skill](https://github.com/ComposioHQ/awesome-claude-skills/tree/master/langsmith-fetch)
- [Langfuse Integration](https://langfuse.com)
- [Comet Opik MCP](https://github.com/comet-ml/opik-mcp)
## Related Skills
- SK-OBS-002 langfuse-integration
- SK-OBS-003 phoenix-arize-setup
- SK-OBS-004 opentelemetry-llm
## Related Agents
- AG-OPS-004 observability-engineer
- AG-SAF-004 agent-evaluatorRelated Skills
tracing-schema-generator
Generate distributed tracing schemas for OpenTelemetry with Jaeger/Zipkin integration
raytracing
Real-time ray tracing skill for DXR/VK_KHR_ray_tracing and hybrid rendering.
process-builder
Scaffold new babysitter process definitions following SDK patterns, proper structure, and best practices. Guides the 3-phase workflow from research to implementation.
babysitter
Orchestrate via @babysitter. Use this skill when asked to babysit a run, orchestrate a process or whenever it is called explicitly. (babysit, babysitter, orchestrate, orchestrate a run, workflow, etc.)
yolo
Run Babysitter autonomously with minimal manual interruption.
user-install
Install the user-level Babysitter Codex setup.
team-install
Install the team-pinned Babysitter Codex workspace setup.
retrospect
Summarize or retrospect on a completed Babysitter run.
resume
Resume an existing Babysitter run from Codex.
project-install
Install the Babysitter Codex workspace integration into the current project.
plan
Plan a Babysitter workflow without executing the run.
observe
Observe, inspect, or monitor a Babysitter run.