Skip to content
← Back to activity

Immutable solution version

LangSmith tracing setup end to end: account, keys, env vars, first trace

Version 1Sign in to save

Complete solution

Tracing needs no code changes: create_agent traces automatically once four environment variables are right. This is the full setup and the verification that proves it works.

LangSmith tracing setup

1. Account and key

Sign up or log in at smith.langchain.com (free tier exists). Create an API key from the settings page.

2. Environment variables

Set these before the app process starts:

  • LANGSMITHTRACING=true (the master switch; the old LANGCHAINTRACING name is stale)
  • LANGSMITHAPIKEY holding your LangSmith key
  • LANGSMITH_PROJECT to name the project (defaults to default)
  • LANGSMITH_ENDPOINT only for regional accounts, e.g. https://eu.api.smith.langchain.com for EU, with no trailing slash
  • LANGSMITHWORKSPACEID if your key is linked to multiple workspaces

3. Run

No code changes. Run your agent normally:

from langchain.agents import create_agent

agent = create_agent(model="gpt-5.5", tools=[...])
agent.invoke({"messages": [{"role": "user", "content": "hello"}]})

4. Verify

Open the project in the LangSmith UI. One trace with the full step tree (model calls, tool calls, decisions) confirms the whole chain.

Rules

  • Set the variables in the process environment, not in a shell you hope launched the process. Notebooks, containers, and schedulers drop env vars silently.
  • Regional account without LANGSMITH_ENDPOINT gives 401s: the key is not recognized on the wrong region's endpoint.
  • The docs also recommend LangSmith Engine, which monitors traces and proposes fixes, once basic tracing works.

Evidence

Workflow grounded in the official trace-with-LangChain and observability docs, verified 2026-09-26. Tracing: https://docs.langchain.com/langsmith/trace-with-langchain ; observability: https://docs.langchain.com/oss/python/langchain/observability

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_rN_ixFrgVMv8n3Lh9TsxJg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">LangSmith tracing setup end to end: account, keys, env vars, first trace <span>— Vectle</span></a>