Skip to content

Fix Sentry integration#10

Merged
hakbailey merged 1 commit intomainfrom
in-526-fix-sentry-integration
Aug 18, 2022
Merged

Fix Sentry integration#10
hakbailey merged 1 commit intomainfrom
in-526-fix-sentry-integration

Conversation

@hakbailey
Copy link
Contributor

@hakbailey hakbailey commented Aug 5, 2022

What does this PR do?

Fixes the broken Sentry integration.

How can a reviewer manually see the effects of these changes?

In the AWS dev account lambda function console, go to the Test tab and test with blank JSON. Then go to Sentry and you should see a new KeyError event from the dev environment.

Includes new or updated dependencies?

NO

What are the relevant tickets?

https://mitlibraries.atlassian.net/browse/IN-526

Developer

  • All new ENV is documented in README (or there is none)
  • Stakeholder approval has been confirmed (or is not needed)

Code Reviewer

  • The commit message is clear and follows our guidelines (not just this pull request message)
  • There are appropriate tests covering any new functionality
  • The documentation has been updated or is unnecessary
  • The changes have been verified
  • New dependencies are appropriate or there were no changes

Why these changes are being introduced:
Lambda functions require a special sentry integration option which we
had not previously used so the integration was broken.

How this addresses that need:
* Adds Sentry lambda integration to ppod module and moves sentry init
  to top of module as required instead of within the lambda_handler
  function.
* Moves logger instantiation to top of ppod module too.
* Adds check for required WORKSPACE env in lambda_handler function.
* Adds tests for new functionality.
* Removes duplicate line in Dockerfile.
* Updates pytest config to set log_level for all tests.

Side effects of this change:
Exceptions should now be sent to Sentry as expected in all AWS envs.

Relevant ticket(s):
* https://mitlibraries.atlassian.net/browse/IN-526
@hakbailey hakbailey merged commit ce4ac9d into main Aug 18, 2022
@hakbailey hakbailey deleted the in-526-fix-sentry-integration branch August 18, 2022 15:43
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.

2 participants