- 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 node source file. Edit below section of the file where you replace 'dsn' with your own DSN
Sentry.init({
dsn: "<your DSN>",
});
npm install$zip -r filename.zip *Create a Lambda function in Node by uploading the zip file created in 'creating development package' section with LambdaAdminAccess and test event configured. For more information refer to Node Lambda function.
This function contains code that instruments lambda initialization error. This is instrumented by calling undefined function before invoking the Lambda handler.
a) Handler : initialization.handler
b) Timeout : 1 minThis function contains code that instruments handled the exception.
a) Handler : handled_exception.handlerThis 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 : 10 secScenario: Wrong PORT number
In this scenario, we put the wrong PORT number.
a) Handler : network_error_wrong_port.handler
b) Timeout : 10 secThis function contains code that instruments the handled exception and creates custom tag & context.
a) Handler : custom_tag_and_context.handler
b) Environment Variables :-
Key : ENV_VAR
Value : env_variable_value