Skip to content

fix(integrations): Fix Lambda integration with EventBridge source - #2546

Merged
sentrivana merged 3 commits into
getsentry:masterfrom
davidcroda:fix-aws-lambda-integration
Dec 1, 2023
Merged

sentrivana merged 3 commits into
getsentry:masterfrom
davidcroda:fix-aws-lambda-integration

Conversation

@davidcroda

Copy link
Copy Markdown
Contributor

When a lambda is triggered by an AWS EventBridge pipe the record contains an explicit "header" key with an empty list. This breaks the assumption that headers is always a dict or None. Update the AwsLambdaIntegration to explicitly verify that header is a dict before passing it on to the continue_trace function.

Fixes GH-2545

@sentrivana sentrivana left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @davidcroda, thanks a ton for reporting the issue and fixing it in one go! I left a tiny suggestion, please address it and then if the tests look good (I'll have to trigger them manually) we should be good to merge.

Comment thread sentry_sdk/integrations/aws_lambda.py Resolved
davidcroda and others added 2 commits November 30, 2023 13:48
When a lambda is triggered by an AWS EventBridge pipe the record
contains an explicit "header" key with an empty list. This breaks the
assumption that headers is always a dict or None. Update the
AwsLambdaIntegration to explicitly verify that header is a dict before
passing it on to the `continue_trace` function.

Fixes getsentryGH-2545
Co-authored-by: Ivana Kellyerova <ivana.kellyerova@sentry.io>
@davidcroda
davidcroda force-pushed the fix-aws-lambda-integration branch from cbf21ae to 2792d17 Compare November 30, 2023 18:48
@davidcroda

Copy link
Copy Markdown
Contributor Author

Sure thing. Thanks for the quick response.

@sentrivana

Copy link
Copy Markdown
Collaborator

Thanks @davidcroda! The AWS Lambda tests are failing but based on the line numbers in the tracebacks they seem to be executing the code before your changes for some reason, so that's something we have to fix -- nothing additional needed from your side.

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.

AwsLambdaIntegration crashes when lambda is triggered by EventBridge Pipe source

2 participants