---
title: JudgmentBaggageProcessor
seo:
  title: JudgmentBaggageProcessor — Python SDK
  description: Copies OTel baggage entries onto span attributes at span start. (Python SDK)
description: Copies OTel baggage entries onto span attributes at span start.
---

| Prop | Type | Default | Description |
| - | - | - | - |
| `BaggageKeyPredicateT?` | `Any` | `Callable[[str], bool]` | Predicate that decides which baggage keys are propagated to span attributes. |
| `ALLOW_ALL_BAGGAGE_KEYS?` | `BaggageKeyPredicateT` | `lambda _: True` | Default predicate that allows every baggage key. |

Copies OTel baggage entries onto span attributes at span start.

When a span starts, this processor reads all baggage from the parent
context and sets matching entries as span attributes. Use
`baggage_key_predicate` to control which keys are propagated.

Allow only Judgment-prefixed baggage keys:

```python
from judgeval.trace.processors import JudgmentBaggageProcessor

processor = JudgmentBaggageProcessor(
    baggage_key_predicate=lambda k: k.startswith("judgment."),
)
```

## \_\_init\_\_()

```python
def __init__(baggage_key_predicate=ALLOW_ALL_BAGGAGE_KEYS) -> None:
```

### Parameters

| Prop | Type | Default | Description |
| - | - | - | - |
| `baggage_key_predicate?` | `BaggageKeyPredicateT` | `ALLOW_ALL_BAGGAGE_KEYS` | |

### Returns

`None`

***

## on\_start()

```python
def on_start(span, parent_context=None) -> None:
```

### Parameters

| Prop | Type | Default | Description |
| - | - | - | - |
| `span` | `Span` | - | |
| `parent_context?` | `Optional[Context]` | `None` | |

### Returns

`None`

***

## on\_end()

```python
def on_end(span) -> None:
```

### Parameters

| Prop | Type | Default | Description |
| - | - | - | - |
| `span` | `ReadableSpan` | - | |

### Returns

`None`

***

## shutdown()

```python
def shutdown() -> None:
```

### Returns

`None`

***

## force\_flush()

```python
def force_flush(timeout_millis=30000) -> bool:
```

### Parameters

| Prop | Type | Default | Description |
| - | - | - | - |
| `timeout_millis?` | `int` | `30000` | |

### Returns

`bool`
