howardyoo / airflow_otel_provider

Airflow Provider for OpenTelemetry
Apache License 2.0
2 stars 2 forks source link

Missing span when using OTEL provider with Airflow 2.10.0 #1

Closed howardyoo closed 2 weeks ago

howardyoo commented 2 weeks ago

OTEL provider causes span to miss its parent when using Airflow 2.10.0

When using OTEL provider with Airflow 2.10.0, the following error may happen:

image

The reason being is that Airflow 2.10.0 has fixed the try_number from being inconsistent, and therefore the real try number is properly set. However, Airflow OTEL implementation has not accounted for this fix, and still continues to apply try_number - 1 when it is generating span id for task instances.

The fix is to check for the version of airflow, and apply try_number - 1 when the version is 2.10.0.