> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fiddler.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# add_session_attributes

> Add a session-level attribute that appears on all spans in the current context.

<Info>Re-exported from [`fiddler_otel.attributes.add_session_attributes`](/sdk-api/otel/add-session-attributes).</Info>

Add a session-level attribute that appears on all spans in the current context.

The attribute is stored in a ContextVar that
`FiddlerSpanProcessor` reads when spans
are started. It is emitted as `fiddler.session.user.{key}` on every span
created in the current thread or async coroutine, and is automatically
propagated from parent spans to child spans.

## Parameters

<ParamField path="key" type="str" required={true}>
  Logical attribute key. Will appear as `fiddler.session.user.{key}`
  in span attributes.
</ParamField>

<ParamField path="value" type="str | int | float | bool" required={true}>
  Attribute value. Accepts `str`, `int`, `float`, or `bool`.
  Numeric values (`int`/`float`) are stored as numeric attributes and will
  appear in the `ValueFloat` column in ClickHouse, enabling range-based
  filtering and metrics. String and boolean values appear in the `ValueString`
  column and support categorical filtering (booleans are stored as `"true"`
  or `"false"`).
</ParamField>

## Returns

<ResponseField>
  None Example: default from fiddler\_otel import add\_session\_attributes add\_session\_attributes("user\_id", "user\_12345") add\_session\_attributes("environment", "production") add\_session\_attributes("priority", 7) add\_session\_attributes("score", 0.95)
</ResponseField>

<Info>See the [canonical reference](/sdk-api/otel/add-session-attributes) for the full description and examples.</Info>
