Skip to content

cross invocation tracecontext propagation#810

Closed
joeyzhao2018 wants to merge 4 commits intomainfrom
joey/cross-invocation-tracecontext-propagation
Closed

cross invocation tracecontext propagation#810
joeyzhao2018 wants to merge 4 commits intomainfrom
joey/cross-invocation-tracecontext-propagation

Conversation

@joeyzhao2018
Copy link
Copy Markdown
Contributor

@joeyzhao2018 joeyzhao2018 commented Apr 30, 2026

closing this pr. moving to another pr: #818

joeyzhao2018 and others added 4 commits April 30, 2026 00:38
Introduce a two-tier extraction priority for AWS Lambda durable execution
events in ``datadog_lambda.tracing.extract_context_from_durable_execution``:

  1. Highest-numbered ``_datadog_{N}`` STEP checkpoint (written by the
     ``aws_durable_execution_sdk_python`` integration on a prior invocation).
  2. Datadog headers found in the event's original ``InputPayload`` —
     handles upstream-instrumented invokers that embed propagation headers
     under ``_datadog`` or ``headers``.

If neither yields a context the function returns ``None`` and the existing
extraction chain continues; on the first invocation of a fresh durable
execution the tracer mints a new trace, and subsequent invocations recover
that same trace via the priority-1 checkpoint.

``create_durable_execution_root_span`` continues to emit ``aws.durable-execution``
as the root span on the very first invocation only; the span id is left as
whatever the tracer mints, since the dd-trace-py integration discovers it via
a grandparent walk in the live span tree.

The wrapper finishes the durable root span after ``aws.lambda`` so the
suspend-path checkpoint write in dd-trace-py captures the fully-resolved
trace context.

Strips a handful of leftover ``[DD-DURABLE]`` ``print()`` debug lines that
would have spammed production Lambda logs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@joeyzhao2018
Copy link
Copy Markdown
Contributor Author

closing this pr. moving to another pr: #818

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant