Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[util-genai] Investigate streaming helpers for agent and workflow invocations

Open
#595 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
python

Research direction

Start by reading SyncStreamWrapper and AsyncStreamWrapper in opentelemetry-util-genai, then compare the qwen-agent and agno instrumentation approaches described in the issue. Investigate how agent and workflow invocations can avoid unsupported client token metrics while sharing chunk accumulation and structured-object serialization. Done means a clear, project-consistent approach is identified and its expected behavior is documented.

Written by the indexing model from the issue text.

Description

SyncStreamWrapper and AsyncStreamWrapper in opentelemetry-util-genai are designed around LLM inference invocations (chat, generate_content). When passed an invocation, they mark it as streamed and record client token streaming metrics (gen_ai.client.operation.time_to_first_chunk and time_per_output_chunk) on each chunk.

Agent (invoke_agent) and workflow (invoke_workflow) operations do not define these client token metrics under GenAI semantic conventions. As a result, agent instrumentations either avoid passing the invocation to super().__init__ (e.g. qwen-agent) to manage the lifecycle manually, or pass it and emit invalid metrics (e.g. agno).

Agent instrumentations also duplicate logic for accumulating stream chunks into output_messages based on content capture settings, and serializing structured content (Pydantic models, dataclasses) into JSON strings.

Investigate possible approaches in util-genai to:

  • Support streaming agent and workflow invocations without recording client token timing metrics.
  • Reduce boilerplate across agent instrumentations for chunk content accumulation and structured object serialization.
Dominant language
Python
Stars
46
Forks
93
Avg merge
2d 7h
Merged PRs (30d)
117

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from open-telemetry/opentelemetry-python-genai

All issues in open-telemetry/opentelemetry-python-genai

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.