Skip to content

feat: tool call spans via tool_post_invoke hook #1049

Closed

Description

@ajbozarth

Background

Tool calls have no tracing today. The tool_post_invoke hook exists (consumed by ToolMetricsPlugin) and is the right attach point. Replaces retired sub-issue #474.

Scope

  • Add a ToolTracingPlugin in tracing_plugins.py that emits a tool.call span on tool_post_invoke (and a companion pre-invoke hook if one exists, or a small prerequisite issue to add one).
  • Attributes: gen_ai.tool.name, gen_ai.tool.call.id (semconv), plus Mellea-specific mellea.tool.arguments_hash, mellea.tool.status.
  • Make tool spans children of the backend generation span when possible.

Phase & dependencies

Phase 2 (coverage). Depends on Phase 1 (#1045, #1046, #1047). Can proceed in parallel with #1048, #1050, #1051, #1052, and with PR #1036 rebased onto Phase 1.

Acceptance criteria

  • Every tool invocation emits a span.
  • Span attributes follow OTel GenAI semconv where defined.

Parent epic: #444

Activity

  1. added
    enhancement
    area/telemetry
    on May 19, 2026
  2. added
    area/tools
    on May 20, 2026
  3. added
    p2
    on Jun 18, 2026
  4. self-assigned this
    on Jul 15, 2026
  5. added 3 commits that reference this issue on Jul 21, 2026
    c05fc81
    1923775
    524bd5f
  6. added a commit that references this issue on Jul 23, 2026
    d024969
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/telemetryarea/toolsenhancementp2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions