dstandish opened a new pull request, #68592:
URL: https://github.com/apache/airflow/pull/68592

   **Depends on #68591.** Until that merges, this PR's diff also includes its 
commits — review only the final commit, *"Forward run-identity attributes to 
the trace sampler"*. Will rebase once #68591 lands.
   
   ## What
   
   Builds on the head-sampling change in #68591. Adds a generic `attributes` 
param to `new_dagrun_trace_carrier`, forwarded to `sampler.should_sample(...)`, 
so a custom sampler can differentiate the head-sampling decision by run kind 
(e.g. by `airflow.dag_id` / `airflow.run_type`).
   
   A shared `dagrun_trace_attributes(dr)` helper defines those identity 
attributes once and is reused at both carrier-creation sites (`DagRun.__init__` 
and the clear path) and on the emitted `dag_run` span — which now also carries 
`airflow.run_type` (previously only `dag_id`).
   
   ## Notes
   
   - Built-in samplers ignore the attributes; a custom sampler is what would 
read them. They are decision input only — not persisted in the carrier, not 
attached to the non-recording carrier span.
   - At emit time `_emit_dagrun_span` passes its attributes into `start_span`, 
which the SDK forwards to `should_sample` again (the dag_run span re-samples as 
a root), so a custom sampler sees them there too.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


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