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.

