Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from Dec 1, 2023

Conversation

davidcroda
Copy link
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

Copy link
Contributor

@sentrivana sentrivana left a comment

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.

sentry_sdk/integrations/aws_lambda.py Outdated Show resolved Hide 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
Copy link
Contributor Author

Sure thing. Thanks for the quick response.

@sentrivana sentrivana added the Trigger: tests using secrets PR code is safe; run CI label Dec 1, 2023
@sentrivana
Copy link
Contributor

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.

@github-actions github-actions bot removed the Trigger: tests using secrets PR code is safe; run CI label Dec 1, 2023
@sentrivana sentrivana added the Trigger: tests using secrets PR code is safe; run CI label Dec 1, 2023
@sentrivana sentrivana enabled auto-merge (squash) December 1, 2023 12:23
@sentrivana sentrivana merged commit 837f294 into getsentry:master Dec 1, 2023
470 of 472 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Trigger: tests using secrets PR code is safe; run CI
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