cross invocation tracecontext propagation#810
Draft
joeyzhao2018 wants to merge 4 commits intomainfrom
Draft
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Motivation
Testing Guidelines
Additional Notes
Types of Changes
Check all that apply