# set_tracing_parent

> **Function** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/run_helpers/set_tracing_parent)

Set a RunTree as the active tracing parent within this block.

Unlike `tracing_context`, this only sets the parent run tree and nothing
else, making it safe to use in isolated threads where you want precise
control over which run acts as the parent without inheriting or overwriting
other context variables.

## Signature

```python
set_tracing_parent(
    run_tree: run_trees.RunTree,
) -> Generator[None, None, None]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `run_tree` | `run_trees.RunTree` | Yes | The RunTree to use as the active parent. |

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/791701a304a72495d108669ef11c194983fd0e95/python/langsmith/run_helpers.py#L83)