Skip to content

cross invocation tracecontext propagation#810

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

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

Conversation

@joeyzhao2018
Copy link
Copy Markdown
Contributor

What does this PR do?

Motivation

Testing Guidelines

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

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