Skip to content

agent: trace runs as OpenTelemetry spans #3908

Description

@asim

Goal

Make agent runs observable as first-class runtime work by mapping RunInfo events, tool calls, delegation, and failures into OpenTelemetry spans.

Scope

  • Add additive instrumentation around agent run execution without changing public agent APIs.
  • Correlate run IDs, step/tool/delegation events, status, and provider failures with existing trace context where available.
  • Keep default behavior no-op when tracing is not configured.
  • Add deterministic tests or harness coverage that does not require provider secrets.

Acceptance criteria

  • Agent run traces include run ID, agent name, model/provider when known, step/tool/delegation events, status, duration, and error attributes.
  • micro inspect/run history breadcrumbs can point developers at trace correlation data when tracing is enabled.
  • go test ./... covers the instrumentation path with a mock tracer/exporter.
  • No breaking public API changes or required new runtime dependency defaults.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions