# TracingMiddleware

> **Class** in `langsmith`

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

Middleware for propagating distributed tracing context using LangSmith.

This middleware checks for the `'langsmith-trace'` header and propagates the
tracing context if present. It does not start new traces by default.

Designed to work with ASGI applications.

## Signature

```python
TracingMiddleware(
    self,
    app,
)
```

## Constructors

```python
__init__(
    self,
    app,
)
```

| Name | Type |
|------|------|
| `app` | `unknown` |


## Properties

- `app`

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/6a74bf5af9e542d8065af8edca54b2448f430916/python/langsmith/middleware.py#L4)