-
Notifications
You must be signed in to change notification settings - Fork 1.5k
How to use distributed tracing in your agent server #1961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Mintlify preview ID generated: preview-wfhage-1766013107-bdcc989 |
katmayb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a couple typos and some links, thanks!
|
|
||
| Distributed tracing links runs across services using context propagation headers: | ||
|
|
||
| 1. The **client** infers the trace context from the current run and sends it as HTTP headers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 1. The **client** infers the trace context from the current run and sends it as HTTP headers | |
| 1. The **client** infers the trace context from the current run and sends it as HTTP headers. |
| Distributed tracing links runs across services using context propagation headers: | ||
|
|
||
| 1. The **client** infers the trace context from the current run and sends it as HTTP headers | ||
| 2. The **server** reads the headers and adds them to the run's config and metadata as `langsmith-trace` and `langsmith-project` configurable values. You can choose to use thes to set the tracing context for a given run when your agent is used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 2. The **server** reads the headers and adds them to the run's config and metadata as `langsmith-trace` and `langsmith-project` configurable values. You can choose to use thes to set the tracing context for a given run when your agent is used. | |
| 2. The **server** reads the headers and adds them to the run's config and metadata as `langsmith-trace` and `langsmith-project` configurable values. You can choose to use these to set the tracing context for a given run when your agent is used. |
| <Tabs> | ||
| <Tab title="RemoteGraph"> | ||
|
|
||
| Set `distributed_tracing=True` when initializing `RemoteGraph`. This automatically propagates trace headers on all requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Set `distributed_tracing=True` when initializing `RemoteGraph`. This automatically propagates trace headers on all requests. | |
| Set `distributed_tracing=True` when initializing @[`RemoteGraph`]. This automatically propagates trace headers on all requests. |
| description: Unify traces when calling your deployed Agent Server from another service using RemoteGraph or the SDK. | ||
| --- | ||
|
|
||
| When you call a deployed Agent Server from another service, you can propagate trace context so that the entire request appears as a single unified trace in LangSmith. This uses LangSmith's [distributed tracing](/langsmith/distributed-tracing) capabilities, which propagate context via HTTP headers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| When you call a deployed Agent Server from another service, you can propagate trace context so that the entire request appears as a single unified trace in LangSmith. This uses LangSmith's [distributed tracing](/langsmith/distributed-tracing) capabilities, which propagate context via HTTP headers. | |
| When you call a deployed [Agent Server](/langsmith/agent-server) from another service, you can propagate trace context so that the entire request appears as a single unified trace in LangSmith. This uses LangSmith's [distributed tracing](/langsmith/distributed-tracing) capabilities, which propagate context via HTTP headers. |
| </Tab> | ||
| <Tab title="SDK"> | ||
|
|
||
| If you're using the LangGraph SDK directly, propagate trace headers manually using `run_tree.to_headers()`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| If you're using the LangGraph SDK directly, propagate trace headers manually using `run_tree.to_headers()`: | |
| If you're using the [LangGraph SDK](/langsmith/reference) directly, propagate trace headers manually using `run_tree.to_headers()`: |
No description provided.