dstandish opened a new issue, #67210:
URL: https://github.com/apache/airflow/issues/67210

   ### Context
   
   In `airflow-core/src/airflow/models/dagrun.py::_emit_dagrun_span`, the Dag 
run span is currently started with `context=context.Context()`, which forces it 
to be a **root span** regardless of any active parent context.
   
   ### Proposal
   
   Make this configurable so the Dag run span can either:
   
   - be **nested under the currently active parent span** — this should be the 
**default behavior** (achieved by omitting `context=` so OpenTelemetry uses the 
active context), or
   - be a **root span** — used only when Airflow itself initiates the run and 
there is no meaningful upstream parent to attach to: dag triggered via the API, 
the scheduler, or backfill.
   
   ### Acceptance criteria
   
   - The call site in `_emit_dagrun_span` no longer unconditionally passes 
`context.Context()`.
   - A signal/argument (e.g. plumbed through from the trigger source) decides 
between "nested under active parent" (default) and "force root span".
   - Airflow-initiated paths (API trigger endpoint, scheduler, backfill) opt in 
to the root-span mode.
   - The inline TODO at `_emit_dagrun_span` is removed once implemented.
   
   ### Refs
   
   - PR review comment: 
https://github.com/apache/airflow/pull/63568#discussion_r3066479719
   - PR: https://github.com/apache/airflow/pull/63568


-- 
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]

Reply via email to