getClient()
Access the Respan client for span and trace operations
Overview
getClient() returns the tracing client instance for manual span operations. Use it to read IDs, update spans, add events, and manage traces.
Signature
Basic Usage
Update Current Span
Record Exceptions
Add Events
Available Client Methods
Best Practices
- Use
getClient()within traced functions (workflow, task, agent, tool) - Call client methods only when a span is active
- Add events for significant milestones in your logic
- Record exceptions for better error tracking
- Update spans with custom metadata for filtering and analysis