swarmauri.core.tracing.ITraceContext module

class swarmauri.core.tracing.ITraceContext.ITraceContext[source]

Bases: ABC

Interface for a trace context, representing a single trace instance. This context carries the state and metadata of the trace across different system components.

abstract add_attribute(key, value)[source]

Adds or updates an attribute associated with this trace.

Parameters:
  • key (str) – The attribute key or name.

  • value (Any) – The value of the attribute.

abstract get_trace_id()[source]

Retrieves the unique identifier for this trace.

Returns:

The unique trace identifier.

Return type:

str