diff --git a/airflow-core/tests/integration/otel/test_otel.py b/airflow-core/tests/integration/otel/test_otel.py index d19756094b6ce..1f24e2ec4f6cd 100644 --- a/airflow-core/tests/integration/otel/test_otel.py +++ b/airflow-core/tests/integration/otel/test_otel.py @@ -469,7 +469,10 @@ def test_export_metrics_during_process_shutdown(self, capfd): "_execute_task": "run", "finalize": "worker.task1", "run": "worker.task1", - "sub_span1": "_execute_task", + # At detail level > 1 the execute callable is wrapped in its own + # task.execute span, so operator-emitted spans nest under it. + "task.execute": "_execute_task", + "sub_span1": "task.execute", "dag_run.otel_test_dag": None, "task_run.task1": "dag_run.otel_test_dag", "worker.task1": "task_run.task1",