kaxil opened a new pull request, #73903: URL: https://github.com/apache/airflow/pull/73903
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 on `otel_on` would override that decision. When a provider is installed, nothing changes. Pairs with Common AI's `agent_framework_tracing()`, which applies the same rule on Airflow versions without this fix. --- * Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information. Note: commit author/co-author name and email in commits become permanently public when merged. * For fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed. * When adding dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x). * For significant user-facing changes create newsfragment: `{pr_number}.significant.rst`, in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments). You can add this file in a follow-up commit after the PR is created so you know the PR number. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
