- Create development package from the source code
- Upload it into Lambda console
- Refer usage for use case specific handling
2. Cloned repo contains multiple folders, each of these folder contains an example of how we can capture errors/exceptions on sentry dashboard
3. Go to any folder and edit the python source file. Edit below section of the file where you replace 'dsn' with your own DSN
sentry_sdk.init(
dsn="<your DSN>",
integrations=[AwsLambdaIntegration()]
)
pip install -r requirements.txt
$zip filename.zip *.py *.txt
Create a Lambda function in Python by uploading the zip file created in 'creating development package' section with LambdaAdminAccess and test event configured. For more information refer to Python Lambda function.
This AWS Lambda function contains code that consumes memory limit equal to set memory limit in the configuration.
a) Handler : out_of_memory.lambda_handler
b) Memory (MB) : 128 MB
c) Timeout : 1 min
This Lambda function contains code that instruments Lambda invalid handler error.
a) Handler : invalid_handler.lambda_handler_changed
This function contains code that instruments handled exception.
a) Handler : handled_exception.lambda_handler
This function contains code that instruments unhandled exception.
a) Handler : unhandled_exception.lambda_handler
This function contains code that instruments the network error using different scenarios.
Scenario: Wrong IP address
In this scenario, we put the wrong IP address.
a) Handler : network_error_wrong_address.handler
b) Timeout : 2 min 30 sec
Scenario: Wrong PORT number
In this scenario, we put the wrong PORT number.
a) Handler : network_error_wrong_port.handler
b) Timeout : 2 min 30 sec
This function contains code that instruments the handled exception and creates custom tag & context.
a) Handler : custom_tag_and_context.lambda_handler
b) Environment Variables :-
Key : ENV_VAR
Value : Test Value