Repository navigation
feat(boto3): Add Lambda extension - #8117
Merged
Merged
Conversation
pabloDeputter
marked this pull request as ready for review
October 23, 2026 14:45
Contributor
Coverage Results 📊✅ 57873 passed | ❌ 1 failed | ⏭️ 3058 skipped | Total: 60932 | Pass Rate: 94.98% | Execution Time: 154m 3s 📊 Comparison with Base Branch
➕ New Tests (1)View new tests
❌ Failed Tests
|
| File | Patch coverage | Changed executable lines |
|---|---|---|
| sentry_sdk/integrations/boto3/_utils.py | 88.89% | 8/9 covered; missed: 55; partial branches: 52 |
| sentry_sdk/integrations/boto3/services/lambda.py | 100.00% | 45/45 covered; partial branches: 47 |
| sentry_sdk/consts.py | 100.00% | 10/10 covered |
| sentry_sdk/integrations/boto3/_client.py | 100.00% | 2/2 covered |
| sentry_sdk/integrations/boto3/_services/base.py | 100.00% | 2/2 covered |
Coverage diff
@@ Coverage Diff @@
## master #8117 +/-##
==========================================
+ Coverage 90.25% 90.38% +0.13%
==========================================
Files 203 199 -4
Tracked lines 27114 21598 -5516
Branches 10136 7488 -2648
==========================================
- Hits 24470 19520 -4950
+ Misses 2644 2078 -566
+ Partials 1538 1253 -285Generated by Coverage Action
sentrivana
added a commit
that referenced
this pull request
Oct 29, 2026
### Description Removes `AwsCallContext.service_id_hyphenized` from `sentry_sdk/integrations/boto3/_context.py`. It's still computed on every call (`service_id.hyphenize()`), but on `major/3.0` nothing reads it. It had two readers. One was the `aws.service_id` span tag, which #7261 ("Drop tags auto-set by the SDK") removed. The other was the span name: #7800 ("align span names with OTel conventions") switched that to `ctx.service_id`, so the hyphenized value lost its last reader. This removes the slot, the attribute and the `hyphenize()` call. **Evidence** - On `major/3.0`, `git grep -w service_id_hyphenized` matches only the three lines in `_context.py` that set it up. - The open boto3 extension PRs against `major/3.0` (#8117 SQS, #8137 Lambda) don't reference it. On `master`, `service_id_hyphenized` is still used for the span name and the tag, so this only applies to `major/3.0`. #### Issues n/a <!-- junior-request-attribution:start --> via **Ivana Kellyer**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0BTREZTS2Z%3A1793270559.842119 --> -- [View Junior Session](https://junior-prod.sentry.dev/conversations/slack%3AC0BTREZTS2Z%3A1793270559.842119) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0BTREZTS2Z%3A1793270559.842119/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Ivana Kellyer <ivana.kellyer@sentry.io>
This was referenced Nov 9, 2026
sentrivana
approved these changes
Nov 11, 2026
sentrivana
pushed a commit
that referenced
this pull request
Nov 12, 2026
### Description With #8117 (merged), a synchronous boto3 `Invoke` carries `sentry-trace` and `baggage` in `ClientContext.custom`. This PR adds the receiving side: the Lambda integration continues the trace from `context.client_context.custom`. `ClientContext` wins over event headers, because a forwarded HTTP event can still carry headers from further upstream. `sam local` drops `ClientContext`, so the new `ClientContextTrace` test function hands the event's `client_context` to the runtime. That way the container tests can cover it. This is Pablo's code from `pablo/aws-lambda-client-context-trace`. The one change: `client_context` and `custom` are read with `getattr`, so a context object without them falls back to event headers instead of failing. It's the first of three stacked PRs for the stretch Lambda work: this PR → trigger detection (#8222) → `queue.process` spans (#8223). #### Issues * resolves: PY-3009 (receiving side; #8117 does the injection) * Part of #8071 <!-- junior-request-attribution:start --> via @dingsdax. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0C9X9V5NMT%3A1793904671.980379 --> -- [View Session](https://junior-prod.sentry.dev/conversations/slack%3AC0C9X9V5NMT%3A1793904671.980379) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0C9X9V5NMT%3A1793904671.980379/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: Pablo Deputter <pablo.deputter@sentry.io> Co-authored-by: Pablo Deputter <71842639+pabloDeputter@users.noreply.github.com> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Johannes Daxböck <114897+dingsdax@users.noreply.github.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.
Description
Adds the following attributes:
faas.invoked_name(function name),faas.invoked_provider(aws),faas.invoked_region(region extracted from ARN, else the client's) (all from OTel) onInvoke,InvokeWithResponseStreamandInvokeAsyncaws.lambda.target_function.nameon every other API withFunctionName(feat(attributes): Add AWS Lambda, Step Functions and Secrets Manager name attributes sentry-conventions#716)aws.lambda.resource_mapping.idon the event source mapping APIs, from the request or responseUUIDOther changes:
FunctionErrorsetserror.type=lambda_function_errorClientContext.customis available, we add trace propagation headers; trace continuing in aws-lambda integration is not done yetIssues
Resolves #8069
Part of #8071