Skip to content

Commit 5aae712

Browse files
committed
moved otel_logs closer to relevant code block
1 parent 6897e13 commit 5aae712

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/workflows/recipe/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def unwrap_recipe(header, message):
7171
if mangle_for_receiving:
7272
message = mangle_for_receiving(message)
7373
if header.get("workflows-recipe") in {True, "True", "true", 1}:
74-
otel_logs = None
74+
7575
rw = RecipeWrapper(message=message, transport=transport_layer)
7676

7777
if hasattr(rw, "environment") and rw.environment.get("ID"):
@@ -84,6 +84,7 @@ def unwrap_recipe(header, message):
8484

8585
# Extract span_id and trace_id for logging
8686
span_context = span.get_span_context()
87+
otel_logs = None
8788
if span_context and span_context.is_valid:
8889
span_id = span_context.span_id
8990
trace_id = span_context.trace_id
@@ -97,6 +98,7 @@ def unwrap_recipe(header, message):
9798
otel_logs["recipe_id"] = recipe_id
9899

99100
with ExitStack() as stack:
101+
100102
# Configure the context depending on if service is emitting spans
101103
if (
102104
otel_logs

0 commit comments

Comments
 (0)