dstandish commented on code in PR #63568:
URL: https://github.com/apache/airflow/pull/63568#discussion_r3269386097


##########
shared/observability/src/airflow_shared/observability/traces/__init__.py:
##########
@@ -82,6 +88,28 @@ def new_task_run_carrier(dag_run_context_carrier):
     return carrier
 
 
+def build_trace_state_entries(task_span_detail_level) -> list[tuple[str, str]]:
+    trace_state_entries = []
+    if task_span_detail_level is not None:
+        try:
+            level = int(task_span_detail_level)
+        except Exception:
+            level = None
+        if level:
+            trace_state_entries.append((TASK_SPAN_DETAIL_LEVEL_KEY, 
str(level)))
+    return trace_state_entries
+
+
+def get_task_span_detail_level(span: Span):
+    span_ctx = span.get_span_context()
+    trace_state = span_ctx.trace_state
+    try:
+        return int(trace_state.get(TASK_SPAN_DETAIL_LEVEL_KEY, 
default=DEFAULT_TASK_SPAN_DETAIL_LEVEL))
+    except Exception:
+        log.warning("%s config in dag run conf must be integer.", 
TASK_SPAN_DETAIL_LEVEL_KEY)
+        return DEFAULT_TASK_SPAN_DETAIL_LEVEL

Review Comment:
   resolved this one.



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