feat(otel): Instrument dynamic workflows#947
Open
RKest wants to merge 1 commit into
Open
Conversation
wolo-lab
approved these changes
Jun 5, 2026
| // Mirrors test_telemetry_schema in | ||
| // adk-python/tests/unittests/telemetry/test_node_functional.py. | ||
| func TestTelemetrySchema_WorkflowChain(t *testing.T) { | ||
| func TestTelemetrySchema_Workflow(t *testing.T) { |
There was a problem hiding this comment.
we have two workflow types: static and dynamic. I think we should cover both of them, so just add a new test instead of replacing it.
| // | ||
| // Mirrors test_telemetry_schema in | ||
| // adk-python/tests/unittests/telemetry/test_node_functional.py. | ||
| func TestTelemetrySchema_WorkflowChain(t *testing.T) { |
There was a problem hiding this comment.
it would be nice to have some more tests with error handling
- e.g. upper_node returning error.
- check that
ErrNodeInterruptedis properly handled
| } | ||
| childPath := s.parentPath + "/" + name + "@" + runID | ||
|
|
||
| if cached, ok := s.lookupCachedOutput(childPath); ok { |
There was a problem hiding this comment.
just to double check that it is desired behavior: cache lookup won't emit span. If so we could add a small comment so in the future we would know that it is ok.
| // Session, invocation metadata, and cancellation come from | ||
| // s.parentCtx. opts carries the resolved RunNodeOption arguments. | ||
| func (s *dynamicSubScheduler) runNode(child Node, input any, opts runNodeOptions) (any, error) { | ||
| func (s *dynamicSubScheduler) runNode(child Node, input any, opts runNodeOptions) (result any, err error) { |
There was a problem hiding this comment.
super nit: result name is used but in the code we have return **out**, nil. It would be a bit more consistent if we use out or result in both places: in the function signature and in the body
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
Children executed via
workflow.RunNodeinside aDynamicNodewere not instrumented, so RunNode-driven delegation was invisible in the trace tree.Solution:
dynamicSubScheduler.runNodenow opens aninvoke_nodespan per delegated child, nested under the dynamic node's span, and records genuine runtime failures while skipping expected control flow (context.Canceled,ErrNodeInterrupted) to match the top scheduler. The telemetry schema test case was replaced (WorkflowChainCase→WorkflowDynamicCase) to assert the nested span shape.Testing Plan
Unit Tests:
Manual End-to-End (E2E) Tests:
Dynamic node is instrumented:

Checklist
Additional context
N/A