ashb commented on code in PR #62554:
URL: https://github.com/apache/airflow/pull/62554#discussion_r2910859969


##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -1796,6 +1816,22 @@ def finalize(
         log.exception("error calling listener")
 
 
+@contextmanager
+def flush_spans():
+    try:
+        yield
+    finally:
+        provider = trace.get_tracer_provider()
+        if hasattr(provider, "force_flush"):
+            from airflow.sdk.configuration import conf
+
+            timeout_millis = conf.getint(
+                "traces", "otel_task_runner_span_flush_timeout_millis", 
fallback=30000

Review Comment:
   Does this config need to be specific to task_runner, or could it apply to 
all places where we flush before exit?



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