LangChain / LangGraph
Trace LangChain and LangGraph runs over OpenTelemetry. Capture every chain, model call, and tool step with tokens, cost, and latency.
Built by
telemetry.dev
Language
Python + TypeScript
Transport
OTLP/HTTP
Category
AI frameworks
Docs
About the LangChain integration
Instrument LangChain with any OpenTelemetry instrumentation — for example OpenLLMetry — and point the OTLP exporter at our endpoint. Chains, model calls, and tool steps arrive as spans. telemetry.dev detects LangChain and normalizes its span shapes, including traceloop.* attributes, into one model of spans, tokens, and cost.
Key features
- Works with your existing OTel setup: Keep the instrumentation you already use and send standard OTLP/HTTP.
- Chains, tools, and model calls in one trace: Follow a run from retrieval to tool use to model response.
- Server-side cost from real token usage: Cost is computed from emitted token counts and current model pricing.
- Group by model, provider, environment, and user: Break spend and latency down by the dimensions your app emits.
- Standard OTLP, no lock-in: Your traces stay portable because the transport is OpenTelemetry.
Get started
-
Create a telemetry.dev project API key.
-
Set your OTLP exporter to telemetry.dev:
export OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.telemetry.dev" export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer%20$TELEMETRY_DEV_API_KEY" export OTEL_SERVICE_NAME="your-service-name" export OTEL_RESOURCE_ATTRIBUTES="deployment.environment.name=production" # OTLP/HTTP exporters send traces to: # $OTEL_EXPORTER_OTLP_ENDPOINT/v1/traces -
Run your chain. LangChain spans appear in telemetry.dev with tokens, cost, latency, and errors attached.
Prefer tracing the model calls directly?
Because LangChain calls the provider SDKs underneath, our provider wrappers work inside chains too: instrument the openai, anthropic, or google-genai client with telemetry-dev-openai, telemetry-dev-anthropic, or telemetry-dev-google-genai and every model call your chain makes is traced with tokens and cost — no OpenLLMetry required. A native drop-in package for LangChain and LangGraph is on the way.