xBis7 commented on code in PR #69809:
URL: https://github.com/apache/airflow/pull/69809#discussion_r4103628233


##########
shared/observability/src/airflow_shared/observability/traces/__init__.py:
##########
@@ -248,11 +267,21 @@ def _load_exporter_from_env() -> SpanExporter:
     return ep.load()()
 
 
+def set_debug_traces_enabled(enabled: bool) -> None:
+    """Set the debug-traces flag on this module instance."""
+    global _otel_debug_traces_on
+    _otel_debug_traces_on = enabled
+
+
 def configure_otel(conf: ConfigParser):
+    global _otel_debug_traces_on
+
     otel_on = conf.getboolean("traces", "otel_on", fallback=False)
     if not otel_on:
         return
 
+    _otel_debug_traces_on = conf.getboolean("traces", "otel_debug_traces_on", 
fallback=False)

Review Comment:
   To test what you are describing, you need an integration test and this is 
exactly what the new test in `airflow-core/tests/integration/otel/test_otel.py` 
is. It's covering all that.
   
   The test starts an actual scheduler
   
   
https://github.com/xBis7/airflow/blob/27c36126620079d7e861eb6250fd11a13e1f723f/airflow-core/tests/integration/otel/test_otel.py#L463-L465
   
   
https://github.com/xBis7/airflow/blob/27c36126620079d7e861eb6250fd11a13e1f723f/devel-common/src/tests_common/test_utils/integration_setup.py#L71-L105
   
   by doing that, this runs
   
   
https://github.com/xBis7/airflow/blob/27c36126620079d7e861eb6250fd11a13e1f723f/airflow-core/src/airflow/__init__.py#L79
   
   and then
   
   
https://github.com/xBis7/airflow/blob/27c36126620079d7e861eb6250fd11a13e1f723f/airflow-core/src/airflow/settings.py#L833-L869
   
   We are enabling the debug traces here
   
   
https://github.com/xBis7/airflow/blob/27c36126620079d7e861eb6250fd11a13e1f723f/airflow-core/tests/integration/otel/test_otel.py#L456-L458
   
   and the otel traces here
   
   
https://github.com/xBis7/airflow/blob/27c36126620079d7e861eb6250fd11a13e1f723f/airflow-core/tests/integration/otel/test_otel.py#L169
   
   In the scenario that you mentioned, this test will fail.
   



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