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

Prevent AttributeError from being raised when lambda event is a list #1738

Merged

Conversation

e-pavlica
Copy link
Contributor

@e-pavlica e-pavlica commented Mar 30, 2023

Description

When an AWS Lambda is invoked via Step Functions, the event given to the handler may be a list instead of a dict if preceded by a Map state. Currently this causes an AttributeError to be raised in the OTEL instrumentation.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Tested via a Step Function + Lambda
  • Added a basic test for this case

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 30, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: xicreative / name: Evan Pavlica (642a653)

@e-pavlica e-pavlica marked this pull request as ready for review March 31, 2023 00:12
@e-pavlica e-pavlica requested a review from a team as a code owner March 31, 2023 00:12
@e-pavlica e-pavlica force-pushed the list-event-support-aws-lambda branch from 642a653 to 24e2981 Compare March 31, 2023 00:13
@srikanthccv srikanthccv merged commit a7a4f71 into open-telemetry:main Apr 4, 2023
@e-pavlica e-pavlica deleted the list-event-support-aws-lambda branch April 4, 2023 21:25
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.

None yet

3 participants