Skip to main content
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 and automatically propagated from parent spans to child spans.

Parameters

key
str
required
Logical attribute key. Will appear as fiddler.session.user.{key} in span attributes.
value
str | int | float | bool
required
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").

Returns

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)
See the canonical reference for the full description and examples.