nickstenning commented on code in PR #63568:
URL: https://github.com/apache/airflow/pull/63568#discussion_r2983268490
##########
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:
+ 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):
Review Comment:
This isn't essential, but I think it would probably be more idiomatic for
this to take an _optional_ `context.Context` and to call
`trace.get_current_span(ctx=ctx)` itself, rather than having a span passed into
it.
--
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]