This page was verified on July 17, 2026. GenAI libraries and semantic conventions are evolving rapidly, so package configuration and emitted attributes can change between releases. Keep your instrumentation current and verify the fields emitted by the version you deploy.
Prerequisites
- Python 3.10+ or Node.js
- An OTel SDK configured using Python or Node.js
- An LLM provider API key, such as OpenAI or Anthropic
- An OTel Collector configured using Connect OpenTelemetry to Bronto, or a direct OTLP trace exporter
Instrument LangChain
OpenLLMetry provides automatic LangChain instrumentation as part of its broader provider and framework coverage. Use the OpenLLMetry integration guide to choose the bundled SDK or individual instrumentation package, configure content capture, and connect it to your existing OTel provider. The LangChain instrumentation can add spans for framework operations such as chains, agents, and tools. Model-call attributes come from the corresponding provider instrumentation, so their presence depends on the provider, package, and version.What you get
A LangChain trace can contain:- Parent spans representing chains, agents, tools, or other framework operations
- Child spans for calls to instrumented model providers
- Request and response content when content capture is enabled
- Token usage, model metadata, finish reasons, and request parameters when the provider reports them
gen_ai.provider.name, gen_ai.operation.name, gen_ai.request.model, and gen_ai.usage.input_tokens / gen_ai.usage.output_tokens. See LLM Observability for the standard field definitions and query examples.
Framework spans do not necessarily use the same schema as provider spans. Depending on the OpenLLMetry release, LangChain workflow, task, agent, or tool spans may include
traceloop.* compatibility attributes. Inspect an emitted trace before building dashboards that depend on framework-specific fields.Optional: route existing LangSmith traces to Bronto
Use this option only if your application already relies on LangSmith tracing or itstraceable API. LangSmith’s current tracing modes can send those traces to LangSmith, an OTel backend, or both.
Configure your OTel TracerProvider and exporter before importing LangChain or LangSmith components. Then select OTel-only routing:
- Python
- Node.js
Client(tracing_mode="otel").langsmith.* attributes in addition to any standard gen_ai.* fields. If you want traces in both LangSmith and Bronto, use LangSmith’s hybrid or replica routing rather than OTel-only mode; see the current LangSmith routing documentation.
Send traces to Bronto
Via a Collector — point the application’s OTLP trace exporter at the Collector, then configure the Collector using Connect OpenTelemetry to Bronto. This is recommended in production. Direct export — point the trace exporter at the Bronto ingestion endpoint and add your API key:
See API Keys for how to create a key with ingestion permissions.
Verify in Bronto
Open Log Search and filter by theservice.name configured on your OTel resource. To find instrumented model calls that report token usage:
$gen_ai.usage.input_tokens or $gen_ai.usage.output_tokens by $gen_ai.provider.name to compare usage across the providers called by your LangChain application. See LLM Observability for aggregation examples.
If no traces appear, check that instrumentation is initialized before LangChain and the provider SDKs are imported, verify the OTLP endpoint and API-key header, and ensure short-lived processes flush their span processor before exit.

