Trace tool call latency in production by enabling LangSmith tracing, which automatically captures run hierarchies with timing information, and use sampling or tagging to manage data volume.
LangSmith provides automatic end-to-end tracing when LANGSMITH_TRACING_V2=true is enabled. Each tool call appears as a nested run within the chain, showing its start time, end time, latency, inputs, outputs, and any errors [citation:4]. For production scale, use the auto_batch_tracing=True client setting to enable background batching, reducing performance impact. For high-volume applications, set a sampling rate (e.g., LANGSMITH_TRACING_SAMPLING_RATE=0.1) to trace only 10% of requests, maintaining observability while controlling costs [citation:9].
Latency: Each tool call shows duration in the trace timeline
Tool order: Clear visualization of tool execution sequence
Error tracking: Failed tool calls show error messages and stack traces
Cost tracking: For supported providers, token usage and cost appear per tool call
State changes: Memory reads/writes between tool calls are visible