[v3-3-test] Add task.execute detail span around task execute callable (#67877)#69359
Merged
Merged
Conversation
When task span detail level is greater than 1, the actual execute call was not separately traced, making it hard to see how much of a task's runtime was spent in the operator's own work versus the surrounding setup. Wrapping the execute call in its own span gives that finer-grained breakdown. The contextvars context the callable runs in is snapshotted inside the new helper, after the span is current, so spans the operator emits during execute nest under it rather than alongside it. (cherry picked from commit b006a97)
shahar1
approved these changes
Jul 3, 2026
Contributor
|
Hi maintainer, this PR was merged without a milestone set.
|
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.
Backport of #67877 to
v3-3-test.Why
The OTel integration test on
v3-3-test(test_dag_execution_succeeds[detail_spans])expects operator-emitted spans (e.g.
sub_span1) to nest under atask.executespan,but that span was never emitted on
v3-3-test: the test-expectation update (#69236,backported as #69246) landed here without its source dependency #67877, which adds
the
@detail_span("task.execute")wrapper around the operator execute callable.As a result the test deterministically fails (
sub_span1nests under_execute_taskinstead of
task.execute). This surfaced now because #69285 makes CI actually run theOTel integration test on
v3-3-test.This backport restores the missing source change so the span hierarchy matches the
already-backported test expectation, unblocking #69285.
Verification
Cherry-picked from b006a97 (auto-merged cleanly;
task_runner.pyhad diverged butwithout overlapping edits). Verified locally:
_execute_tasknow calls the new_run_execute_callable(@detail_span("task.execute"));contextvars snapshot +
ExecutorSafeguardtracker + execution-timeout handling moved into it.ruffclean.test_task_runner.pyexecute suite passes (12 tests), includingtest_operator_child_spans_nest_under_task_execute.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines