Repository navigation
feat(aws-lambda): Continue the trace from Invoke ClientContext - #8221
Draft
sentry-junior[bot] wants to merge 1 commit into
Draft
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
A synchronous boto3 Invoke now carries sentry-trace and baggage in ClientContext.custom (added with the Lambda service extension). The Lambda integration continues the trace from there. ClientContext wins over event headers, because a forwarded HTTP event can keep headers from further upstream. The ClientContextTrace test function works around sam local, which drops ClientContext, by handing the event's client_context to the runtime. Co-Authored-By: Johannes Daxböck <114897+dingsdax@users.noreply.github.com>
This was referenced Nov 9, 2026
Contributor
Coverage Results 📊✅ 57651 passed | ⏭️ 2979 skipped | Total: 60630 | Pass Rate: 95.09% | Execution Time: 157m 33s 📊 Comparison with Base Branch
All tests are passing successfully. ❌ Patch coverage is 20.00% (1 of 5 changed executable lines covered; target 80%). Changed files with executable lines (1)
Coverage diff@@ Coverage Diff @@
## master #8221 +/-##
==========================================
- Coverage 90.30% 90.19% -0.11%
==========================================
Files 203 198 -5
Tracked lines 26933 21392 -5541
Branches 10058 7404 -2654
==========================================
- Hits 24321 19293 -5028
+ Misses 2612 2099 -513
+ Partials 1518 1239 -279Generated by Coverage Action |
This branch has not been deployed
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.
Description
With #8117, a synchronous boto3
Invokecarriessentry-traceandbaggageinClientContext.custom. This PR adds the receiving side: the Lambda integration continues the trace fromcontext.client_context.custom.ClientContextwins over event headers, because a forwarded HTTP event can still carry headers from further upstream.sam localdropsClientContext, so the newClientContextTracetest function hands the event'sclient_contextto the runtime. That way the container tests can cover it.This is Pablo's code from
pablo/aws-lambda-client-context-trace, squashed into one commit with no other changes. It's the first of three stacked drafts for the stretch Lambda work: this PR → trigger detection →queue.processspans. It's a draft so CI can run the Lambda container tests on it for the first time.Issues
Invoke#8071via @dingsdax.
--
View Session [Sentry]