Set the tracing context for a block of code.
tracing_context(
*,
project_name: Optional[str] = None,
address: Optional[AgentAddress] =| Name | Type | Description |
|---|---|---|
project_name | Optional[str] | Default: NoneThe name of the project to log the run to. |
address | Optional[AgentAddress] | Default: NoneAn |
tags | Optional[list[str]] | Default: None |
metadata | Optional[dict[str, Any]] | Default: None |
parent | Optional[Union[run_trees.RunTree, Mapping, str, Literal[False]]] | Default: None |
client | Optional[ls_client.Client] | Default: None |
enabled | Optional[Union[bool, Literal['local']]] | Default: None |
replicas | Optional[Sequence[Union[WriteReplica, str]]] | Default: None |
distributed_parent_id | Optional[str] | Default: None |
The tags to add to the run.
The metadata to add to the run.
The parent run to use for the context.
Can be a Run/RunTree object, request headers (for distributed tracing),
or the dotted order string.
The client to use for logging the run to LangSmith.
Whether tracing is enabled.
Defaults to None, meaning it will use the current context value or environment variables.
A sequence of WriteReplica dictionaries or addresses
to send runs to.
Example: [{"api_url": "https://api.example.com", "auth": {"api_key": "key"}, "project_name": "proj"}]
or [{"project_name": "my_experiment", "updates": {"reference_example_id": None}}]
The distributed parent ID for distributed tracing. Defaults to None.