TOOL WIKI · OBSERVABILITY
LangSmith
Connects agent traces, evaluations, and performance monitoring.
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
Propagate a trace identifier through models, retrieval, and tools.
Capture meaningful timings and outcomes while excluding unnecessary content.
processTo 03 · LangSmithDebugging agent behavior and turning failures into evaluation cases. Keep trace identifiers aligned across models, tools, and application services.
resultTo 04 · InvestigationJoin parent-child spans and compare observed results with task expectations.
Turn verified failures into repeatable evaluation cases.
Use task success, error rates, latency, and cost to decide what to change.
Result or stopping point
Debugging agent behavior and turning failures into evaluation cases. Keep trace identifiers aligned across models, tools, and application services.
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.
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
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
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
Explore the same layer
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.