open-telemetry / open-telemetry/opentelemetry-python-genai
[langchain] Add nested workflow span on on_chain_start
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39
- Forks
- 63
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 175
Description
[!NOTE]
This issue was generated with AI assistance and requires investigation and confirmation prior to being worked on.
Part of #543.
In on_chain_start, _looks_like_workflow currently suppresses child chains when parent_run_id is not None.
Semantic conventions specify that application-defined workflows should be reported even when nested (e.g. a sub-graph executed as a node of another graph).
- Map nested sub-graphs / workflows to GenAI
invoke_workflow(gen_ai.operation.name: "invoke_workflow") with span nameinvoke_workflow {gen_ai.workflow.name} - Capture
gen_ai.workflow.name - Capture
gen_ai.input.messagesandgen_ai.output.messageswhen content capture is enabled
Contributor 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.
Research direction
Start in the on_chain_start entry point and inspect how _looks_like_workflow handles runs with a parent_run_id. Confirm the applicable semantic conventions, then verify that nested workflows produce invoke_workflow spans with the workflow name and capture input and output messages when content capture is enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 66/100