Skip to content

refactor!: Update Agent tracing to only create one tracing span per loop #11203

Draft
sjrl wants to merge 6 commits intorefactor-agent-tool-invokerfrom
single-tracing-span-per-loop
Draft

refactor!: Update Agent tracing to only create one tracing span per loop #11203
sjrl wants to merge 6 commits intorefactor-agent-tool-invokerfrom
single-tracing-span-per-loop

Conversation

@sjrl
Copy link
Copy Markdown
Contributor

@sjrl sjrl commented Apr 27, 2026

Related Issues

  • WIP and just experimenting

Proposed Changes:

Be more concise with the spans we create for Agent runs. Drop the now unnecessary use of Pipeline._run_component (since break points have been removed) and instead create a single span per loop. This is in-line with the desired removal of ToolInvoker as a component.

This allows the logic to be further simplified and understandable and creates more concise and readable traces.

How did you test it?

Notes for the reviewer

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
haystack-docs Ready Ready Preview, Comment May 5, 2026 9:43am

Request Review

@github-actions github-actions Bot added topic:tests type:documentation Improvements on the docs labels Apr 27, 2026
@sjrl sjrl force-pushed the single-tracing-span-per-loop branch from 9f04f16 to e0b2632 Compare April 28, 2026 05:50
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 28, 2026

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  haystack/components/agents
  agent.py 751, 823-843
Project Total  

This report was generated by python-coverage-comment-action

@sjrl sjrl force-pushed the single-tracing-span-per-loop branch from 155b0d1 to bde728d Compare April 28, 2026 08:38
@sjrl sjrl force-pushed the single-tracing-span-per-loop branch from 72e7fe1 to f3619ff Compare May 5, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic:tests type:documentation Improvements on the docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant