Skip to content

Commit d5916d6

Browse files
jchrostek-ddclaude
andcommitted
fix: remove unnecessary trace_ctx initialization
The trace_ctx variable is only used inside the `if should_trace_cold_start:` block, so initializing it to None beforehand is redundant. Also updated comment to explain WHY we capture trace context before finishing spans (to ensure ColdStartTracer gets the correct trace_id). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6ab7bcf commit d5916d6

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

datadog_lambda/wrapper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ def _after(self, event, context):
312312
and is_new_sandbox()
313313
and not is_managed_instances_mode()
314314
)
315-
trace_ctx = None
316315
if should_trace_cold_start:
317316
trace_ctx = tracer.current_trace_context()
318317

0 commit comments

Comments
 (0)