TOOL WIKI · OBSERVABILITY

LangSmith

Connects agent traces, evaluations, and performance monitoring.

Download example files Code + setup + checks in a ZIP
Jump to a section 10 sections

EXAMPLE USE CASE

Capture an application function and its tool child

A developer needs evidence of what ran, which child operation failed, and how to turn that failure into a reproducible test.

Input
A decorated support function calling decorated lookup_order.
Expected output
A parent support-request trace with the tool result beneath it.
  • Success check: A support-request trace contains a lookup-order tool child.
  • Try a failure: Remove/disable tracing credentials and distinguish export failure from application success.

Example scope: Actual managed trace integration with local business logic.

Official reference · LangSmith

WHAT IT ISAI engineering platform
WHERE IT FITSObservability
SEE HOW THE SYSTEM FITS TOGETHERSELECT A COMPONENT
inputprocessresultcheckoutputAgent runOne trace identityInstrumentationRedacted spans + eventsLangSmithAI engineering platformInvestigationFollow a failed taskRegression datasetConfirmed failuresOperational decisionFix, release, or alert
  1. Propagate a trace identifier through models, retrieval, and tools.

  2. Capture meaningful timings and outcomes while excluding unnecessary content.

  3. Debugging agent behavior and turning failures into evaluation cases. Keep trace identifiers aligned across models, tools, and application services.

  4. Join parent-child spans and compare observed results with task expectations.

  5. Turn verified failures into repeatable evaluation cases.

  6. Use task success, error rates, latency, and cost to decide what to change.

    Result or stopping point
LangSmith

Debugging agent behavior and turning failures into evaluation cases. Keep trace identifiers aligned across models, tools, and application services.

Follow the arrows, then select a component to inspect its responsibility. On mobile, downward arrows connect the next step; bent arrows identify branches and return paths. Select a destination to jump to that component.

When to consider it

  • Debugging agent behavior and turning failures into evaluation cases.

A design decision to make

  • Keep trace identifiers aligned across models, tools, and application services.

Prerequisites and setup

  • Python 3.11+ and synthetic fixtures. Managed tracing sends the recorded data to the configured project.
Shell
python3 -m venv .venv
source .venv/bin/activate
pip install langsmith
export LANGSMITH_API_KEY="YOUR_KEY"
export LANGSMITH_TRACING=true
export LANGSMITH_PROJECT="asg-demo"

Try a small integration

trace.py

Python · trace.py
from langsmith import traceable

@traceable(name="lookup-order",run_type="tool")
def lookup(order_id):
    return {"status":{"A104":"packed"}.get(order_id,"not_found")}

@traceable(name="support-request")
def support(order_id):
    observation = lookup(order_id)
    return {"order_id":order_id,**observation}

print(support("A104"))

Run and check the result

Shell
python trace.py
  • A support-request trace contains a lookup-order tool child.
  • Change the fixture to a missing order and inspect the trace outcome rather than hiding the not_found result.

Common failures

  • No trace: check the project/region, credentials, collector protocol and exporter flush before changing instrumentation.
  • Avoid double instrumentation that produces duplicate model spans or conflicting trace providers.

Production decisions

  • Redact keys, private prompts, personal data and sensitive tool results before exporting telemetry. Configure sampling and retention.
  • Connect request, agent, model and tool spans with parent/child trace context. A successful span is not a quality or authorization verdict.
  • Keep regional API endpoint configuration consistent with the project and use redaction/filtering before trace capture.

Keep exploring

An evaluation gate for agent releasesThe real cost of an agent run

Explore the same layer

LangfuseArize PhoenixOpenTelemetryOpenInference

Compare candidates on your own workload. This entry describes a product’s role; it is not a claim that products in the category are interchangeable.