langchain-agent-tracing
БесплатноБез исполняемых скриптовНе проверенUse when adding, fixing, or reviewing LangSmith tracing for an agent or LLM application, including choosing instrumentation for LangChain, LangGraph, Deep…
от langchain-ai★ 1 369 звёзд на GitHubОб этом скилле
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:
- Register the application as one agent, once, rather than one agent per tier
or script. Reuse an existing agent when it represents the same system.
Registration needs permission to create projects;
langsmith agents createor the docs' programmatic creation flow can do it. - Address traces with
LANGSMITH_AGENT_ID(the stable ID, not the display name) andLANGSMITH_AGENT_ENVIRONMENT:localfor a developer machine and ad hoc scripts;development,staging, orproductionfor deployed tiers. - Remove
LANGSMITH_PROJECT,LANGCHAIN_PROJECT, andLANGCHAIN_SESSIONfrom that runtime. Do not combine legacy destinations with agent addressing. - When an integration only accepts a project name, use the environment's
tracer_session_name. - To route individual requests, such as per tenant or per feature branch, pass an agent address through the SDK's tracing context instead of changing process-wide variables.
In a project-based workspace, set LANGSMITH_PROJECT to the tracing project.
Confirm the region, workspace, and credentials
The application's endpoint and API key determine which organization and
workspace receive traces before the agent or project is applied. Check them in
every runtime that sends traces: local shell, .env files, CI, and deployment
secrets often differ.
- Region or instance:
LANGSMITH_ENDPOINTmust be the API URL for the organization's region or self-hosted instance. Without it, the SDK uses the default US URL, and a key from another region (EU, for example) will not authenticate. Look up the region's URL in the docs instead of guessing it. OpenTelemetry exporters use the same base URL with the OTLP path. - Workspace: when the API key can access more than one workspace, set
LANGSMITH_WORKSPACE_IDto the target workspace. Otherwise traces go to the key's default workspace. Direct API calls and OpenTelemetry exports carry the workspace in theX-Tenant-Idheader. Agent IDs and project names are resolved within that workspace, so the same ID in another workspace is a different agent or none. - Key: use a key from the target organization with permission to write traces there. Never print or log its value.
- Legacy names:
LANGCHAIN_*equivalents of these variables are still read. Remove stale ones so they cannot point traces at another endpoint, workspace, or project.
Compare the application's settings with what the CLI will query:
langsmith auth info --format json reports the CLI's api_url and
workspace_id. If they differ from the application's endpoint or workspace,
pass --api-url and --workspace explicitly; otherwise verification searches
the wrong place and a correctly sent trace looks missing.
Choose the instrumentation layer
Start from what the application already uses:
- LangChain, LangGraph, and Deep Agents trace automatically once tracing and the destination are configured. Agents running on a LangSmith Agent Server are traced by the server; check its deployment settings rather than adding tracing code.
- Another agent framework or model provider: use its official LangSmith
integration when one exists. Find it on the
integrations page under
"Agent frameworks" or "LLM providers", and follow its setup, including how it
selects the agent environment. Wrapping the framework's entry point in
traceableinstead records only your wrapper, not the framework's own agent, model, and tool spans. - Custom Python or TypeScript code: wrap meaningful units of work with
traceableand use the SDK's provider client wrappers so model calls nest under them. - An existing OpenTelemetry pipeline or another language: export to LangSmith's OTLP endpoint with the agent ID and environment headers, or use the SDK's OpenTelemetry support.
Instrument each call once. Combining a framework integration, a wrapper, and an OpenTelemetry exporter on the same calls
Установить langchain-agent-tracing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл langchain-agent-tracing?
Use when adding, fixing, or reviewing LangSmith tracing for an agent or LLM application, including choosing instrumentation for LangChain, LangGraph, Deep Agents, other agent frameworks, or OpenTelemetry; sending traces to the right agent environment or project; grouping turns into threads; metadata; sampling and conditional tracing; redacting sensitive data; distributed tracing across services; and finding traces after they land.
Как установить скилл langchain-agent-tracing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл langchain-agent-tracing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic