Skip to content

trulens.core.schema.event

trulens.core.schema.event

Serializable event-related classes.

Classes

EventRecordType

Bases: Enum

The enumeration of the possible record types for an event.

Trace

Bases: TypedDict

The type hint for a trace dictionary.

Event

Bases: SerialModel, Hashable

The class that represents a single event data entry.

Attributes
event_id instance-attribute
event_id: str

The unique identifier for the event.

record instance-attribute
record: Dict[str, Any]

For a span, this is an object that includes: - name: the function/procedure that emitted the data - kind: SPAN_KIND_TRULENS - parent_span_id: the unique identifier for the parent span - status: STATUS_CODE_ERROR when the span corresponds to an unhandled exception. Otherwise, STATUS_CODE_UNSET.

record_attributes instance-attribute
record_attributes: Dict[str, Any]

Attributes of the record that can either come from the user, or based on the TruLens semantic conventions.

record_type instance-attribute
record_type: EventRecordType

Specifies the kind of record specified by this row. This will always be "SPAN" for TruLens.

resource_attributes instance-attribute
resource_attributes: Dict[str, Any]

Reserved.

start_timestamp instance-attribute
start_timestamp: datetime

The timestamp when the span started. This is a UNIX timestamp in milliseconds. Note: The Snowflake event table uses the TIMESTAMP_NTZ data type for this column.

timestamp instance-attribute
timestamp: datetime

The timestamp when the span concluded. This is a UNIX timestamp in milliseconds. Note: The Snowflake event table uses the TIMESTAMP_NTZ data type for this column.

trace instance-attribute
trace: Trace

The trace context information for the span.

Functions
__rich_repr__
__rich_repr__() -> Result

Requirement for pretty printing using the rich package.