swarmauri.standard.tracing.concrete.SimpleTracer module

class swarmauri.standard.tracing.concrete.SimpleTracer.SimpleTracer[source]

Bases: ITracer

annotate_trace(key, value)[source]

Adds an annotation to an existing trace, enriching it with more detailed information.

Parameters:
  • trace_context (ITraceContext) – The trace context to annotate.

  • key (str) – The key or name of the annotation.

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

end_trace()[source]

Marks the end of a trace, completing its lifecycle and recording its details.

Parameters:

trace_context (ITraceContext) – The trace context to be ended.

classmethod instance()[source]
start_trace(name, initial_attributes=None)[source]

Starts a new trace with a given name and optional initial attributes.

Parameters:
  • name (str) – Name of the trace, usually represents the operation being traced.

  • initial_attributes (Optional[Dict[str, Any]]) – Key-value pairs to be attached to the trace initially.

Returns:

A context object representing this particular trace instance.

Return type:

ITraceContext