Session
Session functionality for Components integration.
SessionConfig
Session config.
This class represents a session config.
SessionConfigDict
Session config dict.
This class represents a session config dictionary.
get_session_config_dict
Convert a session config to a session config dict else return the config.
Arguments:
Name | Description |
---|---|
config | The config to convert. |
Returns:
dict[str, Any]: The session config dict.
Session
A session is a collection of traces.
A session is created when a new session is started.
A session is ended when the session is stopped.
__init__
Create a new session.
Arguments:
Name | Description |
---|---|
config | The configuration for the session. |
trace
Create a new trace for this session.
Arguments:
Name | Description |
---|---|
config | The configuration for the trace. |
Returns:
A new Trace instance.
trace_
Create a new trace for this session.
Arguments:
Name | Description |
---|---|
writer | The LogWriter instance to use. |
session_id | The ID of the session to create the trace for. |
config | The configuration for the trace. |
Returns:
A new Trace instance.
feedback
Add feedback to this session.
Arguments:
Name | Description |
---|---|
feedback | The feedback to add. |
add_attachment
Add an attachment to this session.
Arguments:
Name | Description |
---|---|
attachment | The attachment to add. |
add_attachment_
Add an attachment to this session.
Arguments:
Name | Description |
---|---|
writer | The LogWriter instance to use. |
session_id | The ID of the session to add the attachment to. |
attachment | The attachment to add. |
add_tag_
Add a tag to this session.
Arguments:
Name | Description |
---|---|
writer | The LogWriter instance to use. |
session_id | The ID of the session to add the tag to. |
key | The tag key. |
value | The tag value. |
end_
End this session.
Arguments:
Name | Description |
---|---|
writer | The LogWriter instance to use. |
session_id | The ID of the session to end. |
data | Optional data to add to the session. |
event_
Add an event to this session.
Arguments:
Name | Description |
---|---|
writer | The LogWriter instance to use. |
session_id | The ID of the session to add the event to. |
id | The ID of the event. |
event | The event. |
data | Optional data to add to the event. |