langchain-agent-tracing
Trace agents with LangSmith
Good tracing lands every run in the right place, keeps a request's runs in one trace, keeps sensitive data out, and records what monitoring and evaluation will need later. Decisions made while instrumenting limit what is possible downstream: without a thread ID there are no thread-level evaluators, and without stable metadata there is nothing to filter or alert on.
Decide where traces go
Check how the target workspace organizes traces before configuring a
destination. Run langsmith agents list --workspace <workspace-id> --format json.
If it returns registered agents, the workspace is agent-based. An empty result
or an error is not conclusive: confirm in the LangSmith UI, where the top-left
control names the workspace in an agent-based workspace and shows the LangSmith
logo with an Application picker in a project-based one. If it is still
unclear, ask the user before choosing a destination.
In an agent-based workspace: