Practical Notes
- Per README: SDK v4 rewrite shipped in March 2026 (check the v4 migration guide before upgrading).
- Start with one endpoint/function, then expand tracing to tool calls and background jobs.
- Log only what you can keep: scrub secrets and PII in prompts/responses before shipping traces.
Main
How to use it without over-instrumenting:
- Pick one “golden path” flow (a user question → tool calls → final answer).
- Add tracing at the boundaries: request in, model call out, tool call out, response back.
- Record inputs/outputs + timings first. Only add extra metadata (user IDs, tags, datasets) after the baseline works.
- Create a simple “regression dashboard”: slowest traces, highest error rate, and largest prompt payloads.
The fastest win is spotting which step burns tokens (retrieval, tool results, or prompt templates) and then trimming that step only.
FAQ
Q: Do I need a specific model/provider? A: No—README says it works with any LLM or framework; focus on consistent trace context instead of vendor-specific fields.
Q: Should I log full prompts? A: Only if allowed. Prefer redaction + sampling for sensitive environments; keep enough context to reproduce failures.
Q: What breaks during upgrades? A: SDK major rewrites can change event shapes. Follow the v4 migration guide before upgrading production services.