[util-genai] Investigate streaming helpers for agent and workflow invocations
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
- Domain
- observability-sre
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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from open-telemetry/opentelemetry-python-genai
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
open-telemetry/opentelemetry-python-genai#997 · 1 comment ·
Maintainers usually reply within 1 day
-
Support disabling OpenAI Agents native trace export through an environment variablePossibly taken @123liuziming claimed this 8 days ago. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
open-telemetry/opentelemetry-python-genai#922 · 3 comments ·
Maintainers usually reply within 1 day
-
fix(smolagents): accept tuple inputs for messages, content, and task imagesPossibly taken @SAMurai-16 claimed this 11 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 82/100
open-telemetry/opentelemetry-python-genai#905 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
open-telemetry/opentelemetry-python-genai#857 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
[genai-bedrock] invoke_model body passed as a file-like object: no request parameters or input messages are recordedPossibly taken @SyedTashfin claimed this 18 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
open-telemetry/opentelemetry-python-genai#848 ·
Maintainers usually reply within 1 day
All issues in open-telemetry/opentelemetry-python-genai
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
MIT-LCP/wfdb-python#590 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
pollen-robotics/reachy_mini#1517 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
NRLMMD-GEOIPS/pluginify#41 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
scverse/spatialdata#1293 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
UKGovernmentBEIS/inspect_evals#2788 ·
Maintainers usually reply within 1 day