TraceEvent#

Module: agent_framework.tracing

class agent_framework.tracing.TraceEvent(event_id, parent_event_id, span_id, parent_span_id, timestamp, channel, level, kind, title, summary='', context=<factory>, payload=<factory>, tags=())[source]#

Bases: object

A single trace row on the unified bus.

Semantics by channel:

  • runtime, llm, user: agent / model / user-interaction spans. Typically carry span_id, parent_span_id, and rich TraceContext (run_id, agent_id, …).

  • log: Python logging output. Flat record shape; span_id and parent_span_id stay None; context should only carry session_id when needed for routing.

Parameters:
  • event_id (str)

  • parent_event_id (str | None)

  • span_id (str | None)

  • parent_span_id (str | None)

  • timestamp (str)

  • channel (Literal['runtime', 'llm', 'log', 'user'])

  • level (Literal['debug', 'info', 'warning', 'error'])

  • kind (str)

  • title (str)

  • summary (str)

  • context (TraceContext)

  • payload (dict[str, Any])

  • tags (tuple[str, ...])

event_id: str#
parent_event_id: str | None#
span_id: str | None#
parent_span_id: str | None#
timestamp: str#
channel: Literal['runtime', 'llm', 'log', 'user']#
level: Literal['debug', 'info', 'warning', 'error']#
kind: str#
title: str#
summary: str#
context: TraceContext#
payload: dict[str, Any]#
tags: tuple[str, ...]#
with_context(overlay)[source]#
Parameters:

overlay (TraceContext)

Return type:

TraceEvent