TracerProvider pointing at Agnost before importing LangChain, enable LangSmith’s OTel mode, then pass session_id / user_id per call.
1. Install
Already have LangSmith with the OTel extra and an OTLP exporter installed? Skip. No setup yet?2. Wire OTel + LangSmith pointing at Agnost
The TracerProvider must be registered before importing LangChain: LangSmith detects an existing provider on import and uses it. Already have an OTel TracerProvider? Append Agnost as an additional span processor and switch LangSmith into OTel mode:LANGSMITH_OTEL_ONLY=true stops LangSmith from also shipping to its hosted dashboard: no LangSmith API key needed.
3. Pass user_id / session_id per call
config.metadata with langsmith.metadata.*: Agnost reads langsmith.metadata.session_id and langsmith.metadata.user_id natively for user / session grouping.
