Skip to main content
To trace LangChain with HoneyHive, install honeyhive[openinference-langchain], call HoneyHiveTracer.init(), run LangChainInstrumentor().instrument(tracer_provider=tracer.provider), and use your existing LangChain code unchanged. See the tracing quickstart and tracer initialization guides for setup details. LangChain is a framework for building applications with LLMs. It provides agents, tools, chains, and integrations with model providers. HoneyHive integrates with LangChain through the OpenInference instrumentor, automatically capturing agent runs, tool calls, chain executions, and LLM interactions.

How do I trace LangChain with HoneyHive?

Add HoneyHive tracing in just 4 lines of code. Add this to your existing LangChain app and all agents, tools, and model calls are automatically traced.
To see where to initialize the tracer for your environment, including AWS Lambda and long-running servers, see Tracer Initialization.

Tested Versions

HoneyHive’s LangChain integration is tested against the following versions on PyPI, as of April 2026. Newer patch releases are generally safe; if you hit an issue, pin to these versions to reproduce a known-good configuration. Requires Python 3.11+. The same instrumentor also traces LangGraph.

What Gets Traced

The instrumentor automatically captures:
  • Agent runs - Every create_agent invocation with inputs and outputs
  • LLM calls - Model requests, responses, and token usage
  • Tool calls - Each tool execution with arguments and results
  • Chain operations - LCEL pipes and chain invocations
No manual instrumentation required.

Example: Single Agent with Tools


Example: Multi-Agent Routing

In HoneyHive, you’ll see the full trace hierarchy: router decision, specialist agent delegation, tool executions, and LLM calls.

Troubleshooting

Traces not appearing

  1. Pass the tracer provider - The instrumentor must receive tracer_provider=tracer.provider:
  1. Check environment variables - Ensure HH_API_KEY is set
  2. Initialize before creating agents - Call instrument() before instantiating LangChain agents

Using with LangGraph

LangGraph uses the same OpenInference LangChain instrumentor. If you’ve already set up LangChain instrumentation, LangGraph state graphs are automatically traced too. See the LangGraph integration for custom StateGraph patterns.

LangGraph Integration

Custom state graphs with conditional routing

Enrich Your Traces

Add user IDs and custom metadata to LangChain traces

Custom Spans

Create spans for business logic around agent calls

Distributed Tracing

Trace agents across service boundaries

Using Traceloop (OpenLLMetry) Instead

If your project already uses Traceloop / OpenLLMetry, you can use its LangChain instrumentor instead of OpenInference. The setup is identical - only the install and import paths differ. Note the class name casing: Traceloop ships LangchainInstrumentor (lowercase “c”), while OpenInference ships LangChainInstrumentor.
Tested version: opentelemetry-instrumentation-langchain 0.59.2 (April 2026). The same Traceloop package also traces LangGraph.

Resources