langsmith-trace,以及用于元数据/标签的可选 baggage)关联跨服务的追踪运行。
客户端-服务器设置示例:
- 追踪从客户端开始
- 在服务器上继续
Python 中的分布式追踪
TracingMiddleware 连接分布式追踪。
TracingMiddleware 类是在 langsmith==0.1.133 中添加的。langsmith_extra 来“接收”分布式追踪:
tracing_context 上下文管理器。你也可以在使用 @traceable 包装的方法的 langsmith_extra 参数中直接指定父运行上下文。
TypeScript 中的分布式追踪
TypeScript 中的分布式追踪要求
langsmith 版本为 >=0.1.31langsmith-trace 和 baggage 标头值,然后将这些值传递给服务器:
withRunTree 辅助函数,它会确保运行树在可追踪调用中传播。
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

