Skip to content

OTEL Telemetry #69

@Unshure

Description

@Unshure

Implement OpenTelemetry-based telemetry system for comprehensive tracing of agent operations. Capture detailed traces at agent, cycle, model invoke, and tool execution levels with standardized attributes.

Work Required:

  • Add OpenTelemetry SDK as dependency for tracing collection and export
  • Implement telemetry integration in Agent class with optional trace_attributes during initialization
  • Add Agent-Level tracing with attributes: gen_ai.system, gen_ai.agent.name, gen_ai.user.message, gen_ai.choice, system_prompt, gen_ai.request.model, start/end times, token usage
  • Add Cycle-Level tracing in agent with attributes: agent_loop.cycle_id, user/assistant messages, end_time, choice.message, choice.tool.result
  • Add Model Invoke tracing in model providers with attributes: gen_ai.operation.name, formatted prompts, model ID, start/end times, response, token usage
  • Add Tool-Level tracing with attributes: tool.status, gen_ai.tool.name, gen_ai.tool.call.id, gen_ai.operation.name, start/end times, formatted results
  • Use OpenTelemetry's built-in configuration mechanism for trace export and sampling
  • Integrate tracing into Agent, agent loop, model providers, and tool execution
  • Create unit tests for telemetry data collection and attribute accuracy
  • Create integration test that validates complete trace spans across agent execution

Exit Criteria:

A working OpenTelemetry-based telemetry system that captures comprehensive traces at all execution levels with proper attributes, integrates seamlessly with existing components, and exports traces using OpenTelemetry standards.

Dependencies:

  • task-09-implement-core-agent-class

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions