langchain-agent-tracing
Skill1.4k starsChanged 11 days agoMITView on GitHub
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.
- Reads credentials
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about langchain-ai/langchain-skills
- sudosubin/agents.nix“agent-plugins.github.langchain-ai.langchain-skills: init at 0.4.4”GitHub · Nov 29, 2026
- sudosubin/agents.nix“claude-code-marketplaces.github.langchain-ai.langchain-skills: 0.4.2 → 0.4.4”GitHub · Nov 25, 2026
- sudosubin/agents.nix“claude-code-plugins.github.langchain-ai.langchain-skills: 0.4.2 → 0.4.4”GitHub · Nov 25, 2026
- sudosubin/agents.nix“agent-skills.github.langchain-ai.langchain-skills: 0.4.2 → 0.4.4”GitHub · Nov 25, 2026
- sudosubin/agents.nix“claude-code-plugins.github.langchain-ai.langchain-skills: 0.4.0 → 0.4.2”GitHub · Nov 24, 2026
The biggest 5 of 37 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 37
Talked about on GitHub (37 times).
On GitHub · 37
- Nov 29, 2026agent-plugins.github.langchain-ai.langchain-skills: init at 0.4.4 — sudosubin/agents.nix0 reactions
- Nov 25, 2026claude-code-marketplaces.github.langchain-ai.langchain-skills: 0.4.2 → 0.4.4 — sudosubin/agents.nix0 reactions
- Nov 25, 2026claude-code-plugins.github.langchain-ai.langchain-skills: 0.4.2 → 0.4.4 — sudosubin/agents.nix0 reactions
- Nov 25, 2026agent-skills.github.langchain-ai.langchain-skills: 0.4.2 → 0.4.4 — sudosubin/agents.nix0 reactions
- Nov 24, 2026claude-code-plugins.github.langchain-ai.langchain-skills: 0.4.0 → 0.4.2 — sudosubin/agents.nix0 reactions
32 more on GitHub
- Nov 24, 2026agent-skills.github.langchain-ai.langchain-skills: 0.4.0 → 0.4.2 — sudosubin/agents.nix0 reactions
- Nov 23, 2026claude-code-marketplaces.github.langchain-ai.langchain-skills: 0.4.0 → 0.4.2 — sudosubin/agents.nix0 reactions
- Nov 23, 2026claude-code-plugins.github.langchain-ai.langchain-skills: 0.3.1 → 0.4.0 — sudosubin/agents.nix0 reactions
- Nov 23, 2026agent-skills.github.langchain-ai.langchain-skills: 0.3.1 → 0.4.0 — sudosubin/agents.nix0 reactions
- Nov 23, 2026claude-code-marketplaces.github.langchain-ai.langchain-skills: 0.3.1 → 0.4.0 — sudosubin/agents.nix0 reactions
- Nov 22, 2026agent-skills.github.langchain-ai.langchain-skills: 0.3.0 → 0.3.1 — sudosubin/agents.nix0 reactions
- Nov 22, 2026claude-code-marketplaces.github.langchain-ai.langchain-skills: 0.3.0 → 0.3.1 — sudosubin/agents.nix0 reactions
- Nov 21, 2026claude-code-plugins.github.langchain-ai.langchain-skills: 0.3.0 → 0.3.1 — sudosubin/agents.nix0 reactions
- Nov 20, 2026claude-code-plugins.github.langchain-ai.langchain-skills: 0.2.2 → 0.3.0 — sudosubin/agents.nix0 reactions
- Nov 20, 2026agent-skills.github.langchain-ai.langchain-skills: 0.2.2 → 0.3.0 — sudosubin/agents.nix0 reactions
- Nov 20, 2026claude-code-marketplaces.github.langchain-ai.langchain-skills: 0.2.1 → 0.3.0 — sudosubin/agents.nix0 reactions
- Nov 19, 2026claude-code-plugins.github.langchain-ai.langchain-skills: 0.2.1 → 0.2.2 — sudosubin/agents.nix0 reactions
- Nov 19, 2026agent-skills.github.langchain-ai.langchain-skills: 0.2.1 → 0.2.2 — sudosubin/agents.nix0 reactions
- Nov 16, 2026claude-code-marketplaces.github.langchain-ai.langchain-skills: 0.1.0 → 0.2.1 — sudosubin/agents.nix0 reactions
- Nov 15, 2026claude-code-plugins.github.langchain-ai.langchain-skills: 0.1.0 → 0.2.1 — sudosubin/agents.nix0 reactions
- Nov 15, 2026agent-skills.github.langchain-ai.langchain-skills: 0.1.0 → 0.2.1 — sudosubin/agents.nix0 reactions
- Nov 13, 2026Phase 2.1: mattpocock / langchain 스킬 묶음을 `.agents/skills/`에 설치 — degru82/software-factory0 reactions · 2 comments
- Nov 12, 2026Start searches from a known-sources list — kwonzweig/there-is-a-tool-for-that0 reactions
- Oct 28, 2026claude-code-marketplaces.github.langchain-ai.langchain-skills: init at 0.1.0 — sudosubin/agents.nix0 reactions
- Oct 27, 2026[P0-07] Agent skills for Claude Code and Codex — Hooman1996/RagBot-Assistant0 reactions
- Oct 12, 2026Skill Watch — updates and candidates — ishansing/skills-framework0 reactions · 2 comments
- Oct 4, 2026claude-code-plugins.github.langchain-ai.langchain-skills: init at 0.1.0 — sudosubin/agents.nix0 reactions
- Oct 2, 2026Add online evaluation engineering skill — langchain-ai/langsmith-skills0 reactions
- Sep 29, 2026agent-skills.github.langchain-ai.langchain-skills: init at 0.1.0 — sudosubin/agents.nix0 reactions
- Sep 23, 2026langchain-skills license? — langchain-ai/langchain-plugins0 reactions · 2 comments
- Sep 6, 2026Monthly engineering audit — 2026-09-07 — penguinboy1108/AI_Engineering_Playbook0 reactions
- May 20, 2026Duplicate concepts should collapse into one — janikmu/raidar0 reactions
- May 9, 2026set up LangGraph project — ks6088ts-labs/concierge0 reactions
- Apr 21, 2026SKILL Requests — TBice123123/langchain-dev-utils0 reactions
- Mar 20, 2026Prebuilt LangChain/LangSmith skills / install command — langchain-ai/deepagents0 reactions · 5 comments
- Mar 19, 2026feat: add langchain skills repo links to more docs pages [closes DOC-846] — langchain-ai/docs0 reactions · 2 comments
- Mar 10, 2026Add Claude Code plugin manifest and marketplace — langchain-ai/langsmith-skills0 reactions
In this repository29 other files it gives its agents.
- eval-engineeringSkill
- managed-deep-agentsSkill
- langchain-agent-experimentsSkill
- langchain-agent-monitoringSkill
- langchain-build-agentSkill
- langchain-eval-engineeringSkill
- langchain-managed-deep-agentsSkill
- deep-agents-coreSkill
- deep-agents-memorySkill
- deep-agents-orchestrationSkill
- deepagents-python-quickstartSkill
- deepagents-typescript-quickstartSkill
- ecosystem-primerSkill
- eval-engineeringSkill
- langchain-dependenciesSkill
- langchain-fundamentalsSkill
- langchain-middlewareSkill
- langchain-python-quickstartSkill
- langchain-ragSkill
- langchain-typescript-quickstartSkill
- langgraph-cliSkill
- langgraph-decision-modelsSkill
- langgraph-fundamentalsSkill
- langgraph-human-in-the-loopSkill
- langgraph-persistenceSkill
- langgraph-python-quickstartSkill
- langgraph-typescript-quickstartSkill
- managed-deep-agentsSkill
- swarmSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 7 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Check how the target workspace organizes traces before configuring a destination.
- Distinctive: line 18
If it returns registered agents, the workspace is agent-based.
- Very specific: line 33
Remove LANGSMITH_PROJECT, LANGCHAIN_PROJECT, and LANGCHAIN_SESSION from that runtime.
- Very specific: line 35
When an integration only accepts a project name, use the environment's tracer_session_name.
- Very specific: line 55
Workspace: when the API key can access more than one workspace, set LANGSMITH_WORKSPACE_ID to the target workspace.
- Distinctive: line 61
Key: use a key from the target organization with permission to write traces there.
- Distinctive: line 75
Start from what the application already uses:
- Distinctive: line 81
Another agent framework or model provider: use its official LangSmith integration when one exists.
- Distinctive: line 125
Use the SDK's tracing context to disable tracing for low-value requests or tenants with zero-retention requirements, and to enable it for …
- Distinctive: line 139
Use the SDK's anonymizer or input/output processors to redact known patterns while keeping the rest of the trace.
- Very specific: line 152
When one request crosses services, propagate LangSmith's trace context so the whole request appears as one trace.
- Distinctive: line 158
Only accept these headers from trusted internal services.
- Very specific: line 207
Use langchain-docs → search_docs_by_lang_chain and query_docs_filesystem_docs_by_lang_chain for current setup.
- Very specific: line 217
Before the first workspace command, check langsmith --version and langsmith auth info.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 produces duplicate or disconnected runs. To send the same traces to LangSmith and another backend, use the SDK's tracing modes or replicas rather than parallel instrumentation.
Choose the instrumentation first, then propagate context the way it expects:
the SDK's langsmith-trace and baggage headers for traceable, and W3C
traceparent for OpenTelemetry-based integrations. Don't switch to the SDK
just to make cross-service propagation easier.
Make traces useful for monitoring
- Threads: for multi-turn applications, put a
thread_idin the metadata of every run, including child runs, using one ID per conversation (the docs recommend UUID v7). Runs without it drop out of thread filters and thread token and cost totals. - Metadata and tags: choose a small set of stable metadata keys, such as app version, tenant, feature flag, or model, and use tags for coarse grouping. Keep key names consistent across services so filters and alerts keep working. Never put secrets or raw personal data in metadata or tags.
- Names and boundaries: give runs names that describe the step, and make the root run's inputs and outputs the user-visible request and response. Evaluators and reviewers read the root run first.
For scoring and alerting on these traces, use langchain-agent-monitoring.
Control volume and cost
LANGSMITH_TRACING_SAMPLING_RATE(0 to 1) downsamples traces sent through the SDK and LangChain; it does not apply to direct API logging.- Use the SDK's tracing context to disable tracing for low-value requests or tenants with zero-retention requirements, and to enable it for one code path without turning it on globally.
- Online evaluators sample the traces that remain, so the effective coverage is the product of both rates. Check how sampling treats multi-turn threads before relying on thread-level evaluation of sampled traffic.
Keep sensitive data out
Decide what may leave the process before enabling tracing in production. Choose the narrowest control that meets the requirement:
- Hide all inputs or outputs for a client or process (
LANGSMITH_HIDE_INPUTS,LANGSMITH_HIDE_OUTPUTS) when nothing may be stored. - Use the SDK's anonymizer or input/output processors to redact known patterns while keeping the rest of the trace.
- Redact per request with replica updates when only some tenants need it; follow the docs' caveat about setting the replica destination explicitly, or the redaction can be dropped.
- Disable tracing for a request when even run structure must not be recorded.
- In an OpenTelemetry pipeline, redact span attributes in the collector before export.
Confirm the result by reading a real trace's inputs, outputs, and metadata.
Trace across services
When one request crosses services, propagate LangSmith's trace context so the
whole request appears as one trace. The caller sends the current run's headers
(langsmith-trace, plus baggage for metadata and tags); the receiving service
continues the trace from them through the SDK's tracing context or its tracing
middleware. Calls into a deployed Agent Server have their own guide.
Only accept these headers from trusted internal services. They control how runs are recorded, so strip them from untrusted inbound requests at the gateway.
With OpenTelemetry, every ancestor span must also reach LangSmith. A child whose parent is exported elsewhere or sampled out is dropped without an error, even though the export call succeeds.
Find traces after they land
Resolve the destination to an ID, then query by ID; name-based --project
lookups can silently use a leftover LANGSMITH_PROJECT.
langsmith projects resolve --kind AGENT --id <agent-id> --environment LOCAL --format json
langsmith traces list --project-id <session-id> --last-n-minutes 30 --limit 5 --format json
langsmith traces get <trace-id> --project-id <session-id> --full --format jsonIn a project-based workspace, find the project ID with langsmith projects list.
Narrow traces list with --error, --tags, --metadata key=value, or
--filter. Use langsmith runs list --project-id <session-id> --trace-ids <trace-id>
for the runs in one trace, adding --metadata thread_id=<thread-id> to confirm
child runs carry the thread. Check grouping with langsmith threads list and
langsmith threads get <thread-id> using the same --project-id.
Verify the instrumentation
Exercise the real application path with a realistic request, then use the commands above to confirm:
- The trace is in the intended region, workspace, and agent environment or project, and nowhere else.
- The run tree has the expected structure, with no duplicate or orphaned runs.
thread_idand the chosen metadata appear on child runs, not only the root. LangSmith does not propagate metadata or tags from parent to child runs, so attach them explicitly to each child run that needs them.- Inputs, outputs, and metadata contain no secrets or data that should have been redacted.
- Calls across services appear as one trace.
Tracing exports in the background. Scripts, tests, serverless functions, and workers must flush or shut down the tracer before exiting, or the last traces are lost; look up the flush call for the SDK and language in use. If no trace appears, check that the CLI is querying the same endpoint and workspace as the application, then the API key, agent ID and environment, and whether a sampling rate or tracing context disabled it, before changing code.
Use current tools
Use langchain-docs → search_docs_by_lang_chain and
query_docs_filesystem_docs_by_lang_chain for current setup. Useful searches:
"log traces to an agent", "LangSmith integrations", "trace with OpenTelemetry",
"distributed tracing", "conditional tracing", "sample traces", "threads", and
"prevent logging of sensitive data". Use langchain-reference → search_api,
then get_symbol, for exact signatures of traceable, tracing_context,
wrappers, and client options, and reconcile them with the installed SDK
version. If MCP is unavailable, start from https://docs.langchain.com/llms.txt
and https://reference.langchain.com/llms.txt.
Before the first workspace command, check langsmith --version and
langsmith auth info; do not call langsmith auth token. If a langsmith
command or flag is unknown, the CLI is outdated: run langsmith self-update.
Pin the workspace with --workspace, request --format json when parsing, and
check each command's --help for current flags.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

