Install
valiqor plus langchain>=0.1.0 and langchain-core>=0.1.0.
Zero-Config (Recommended)
Add a single import at the top of your app — all LangChain components are automatically traced:Selective Instrumentation
If you only want LangChain tracing:What Gets Instrumented
LangChain instrumentation covers 5 subsystems:Chat Models
invoke(), ainvoke(), stream(), astream() on any
BaseChatModel subclass — captures model name, vendor, tokens, cost,
and messages.Chains
invoke() and ainvoke() on Runnable chains — captures the full
LCEL pipeline execution.Tools
invoke(), ainvoke(), run(), arun() on BaseTool — captures
tool name, arguments, and results.Retrievers
get_relevant_documents() and aget_relevant_documents() on
BaseRetriever — captures documents, scores, and retrieval metadata.LangGraph
LangGraph is also instrumented automatically:- Graph execution:
invoke()andainvoke()on compiled graphs - Node execution: Individual node functions are wrapped and traced
- State tracking: Graph state transitions are captured
RAG Pipeline Tracing
When using retrievers, Valiqor captures rich RAG-specific data automatically:| Field | Description |
|---|---|
| Documents | Retrieved documents with content snippets |
| Scores | Relevance scores per document |
| Metadata | Document metadata (source, page, etc.) |
| Embedding model | Model used for embeddings (when available) |
| Latency | Retrieval time in milliseconds |
| Top-k | Number of documents retrieved |
Async Support
All LangChain async methods are traced automatically:Streaming
LangChain streaming is supported —stream() and astream() calls
are traced:
Custom Retriever Detection
If you have custom retrieval tools that Valiqor doesn’t detect automatically, you can register them:What Gets Captured
Chat Model Spans
| Field | Description |
|---|---|
model | Model name |
vendor | Provider (auto-detected from class name) |
prompt_tokens | Input tokens |
completion_tokens | Output tokens |
total_tokens | Combined tokens |
cost | Estimated cost in USD |
messages | Full message history |
tool_calls | Tool call arguments and results |
Tool Spans
| Field | Description |
|---|---|
tool_name | Name of the tool |
arguments | Input arguments |
result | Tool output |
duration_ms | Execution time |