Language support
Choose a setup method
Start with one method for a call path. Combining SDK tracking with framework
OpenTelemetry on the same call can create duplicate interactions.
Recommended: Agnost AI skill
Recommended. Choose this path when you want your coding agent to inspect the
project, select a supported transport, make the smallest instrumentation change,
send a test event, and verify that it reached Agnost AI.
Manual setup: Agnost AI SDK
Manual setup: OpenTelemetry
LangChain emits OTel through LangSmith. Register the OTel exporter pointing at Agnost AI before building chains or agents, enable LangSmith’s OTel mode, then passsession_id / user_id per call.
1. Install
Already have LangSmith and an OTLP exporter installed? Skip. No setup yet?2. Wire LangSmith OTel pointing at Agnost AI
The provider must be registered before importing or constructing LangChain objects. Already have an OTel TracerProvider? Append Agnost AI as an additional span processor:Python
langsmith/experimental/vercel is the Vercel AI SDK 7 adapter. LangChain JS/TS should use langsmith/experimental/otel/setup.
For LangChain JS/TS, keep one active OTel span around the actual invoke. The
LangSmith OTel translator attaches LangChain run data to that active span, and
the GenAI attributes below give Agnost AI exact Chat View input/output text.
3. Pass user_id / session_id per call
langsmith.metadata.*: Agnost AI reads langsmith.metadata.session_id and langsmith.metadata.user_id natively for user / session grouping.
For Chat View, keep the assistant answer in the normal LangChain output:
message content, generations, or a chain result wrapper such as answer,
output, or result. Agnost AI stores the raw OTel payload, then collapses those
common output shapes to readable text for the dashboard.
What appears in Agnost AI
- Conversations grouped by
session_id. - User-level analytics grouped by
user_id. - Events for LangSmith OTel spans.
Verify
Run oneagent.invoke, then open Events and confirm langsmith.metadata.session_id and langsmith.metadata.user_id exist.
Troubleshooting
- Register the
TracerProviderbefore importing LangChain. - Set
LANGSMITH_OTEL_ENABLED=trueandLANGSMITH_TRACING=true. - Set
LANGSMITH_OTEL_ONLY=trueif you do not want to also ship to LangSmith.
References
Next steps
- Conversations: review the complete chain or graph execution.
- Events: inspect LangChain and LangGraph spans.
- Intents: organize production conversations by what users wanted.
