Repository navigation
Keep agent framework spans when worker tracing is off - #73903
Merged
Merged
Conversation
With no tracer provider installed in the worker, the task span made the Dag run's propagated trace context current even when that context was unsampled. A span the task's own code then started under a tracer provider it installed, such as an agent framework's, inherited the unsampled flag and was dropped by the default parent-based sampler. The check is whether a provider is installed, not the [traces] otel_on setting, so a provider installed by auto-instrumentation keeps the Dag run's sampling decision.
Lee-W
approved these changes
Sep 30, 2026
This was referenced Oct 8, 2026
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.
With no tracer provider installed in the worker, the task span still made the Dag run's propagated trace context current, and that context is marked as not sampled. A span the task's own code then started, under a tracer provider it installed itself, such as an agent framework's telemetry setup, inherited the unsampled flag and was dropped by the default parent-based sampler. So a Strands or ADK agent's own traces silently disappeared inside an Airflow task.
The task span now drops the parent context when it is unsampled and no tracer provider is installed, so a provider the task code installs later makes its own sampling decision.
The check is whether a provider is installed, not
[traces] otel_on. With auto-instrumentation, a provider exists before the task starts even when Airflow's own tracing is off, and the Dag run was sampled out on purpose; keying onotel_onwould override that decision. When a provider is installed, nothing changes.Pairs with #73901, where Common AI's
agent_framework_tracing()applies the same rule on Airflow versions without this fix.{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.