Manually capture a span (tool call, retrieval, custom) Use this when auto-detection doesn't cover your use case
// Capture a tool callcaptureSpan({ type: 'tool', name: 'get_weather', input: { location: 'San Francisco' }, output: { temperature: 72, conditions: 'sunny' }, durationMs: 150,}); Copy
// Capture a tool callcaptureSpan({ type: 'tool', name: 'get_weather', input: { location: 'San Francisco' }, output: { temperature: 72, conditions: 'sunny' }, durationMs: 150,});
// Capture a retrieval/RAG operationcaptureSpan({ type: 'retrieval', name: 'vector_search', input: { query: 'user question', k: 5 }, output: { documents: [...] }, durationMs: 50,}); Copy
// Capture a retrieval/RAG operationcaptureSpan({ type: 'retrieval', name: 'vector_search', input: { query: 'user question', k: 5 }, output: { documents: [...] }, durationMs: 50,});
Manually capture a span (tool call, retrieval, custom) Use this when auto-detection doesn't cover your use case