Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 1.82 KB

File metadata and controls

38 lines (27 loc) · 1.82 KB

Powertools for AWS Lambda (Java) - Core Utilities Example

This project demonstrates the Lambda for Powertools Java module - including logging, tracing, and metrics.

We provide examples for the following infrastructure-as-code tools:

For each of the tools, the example application is the same, and consists of the following files:

  • App.java - Code for the application's Lambda function.
  • AppTests.java - Unit tests for the application code.
  • events - Invocation events that you can use to invoke the function.

Configuration files and deployment process for each tool are described in corresponding README files.

Test the application

Once the app is deployed, you can invoke the endpoint like this:

 curl https://[REST-API-ID].execute-api.[REGION].amazonaws.com/Prod/hello/

The response itself isn't particularly interesting - you will get back some information about your IP address. If you go to the Lambda Console and locate the lambda you have deployed, then click the "Monitoring" tab you will be able to find:

  • View X-Ray traces - Display the traces captured by the traces module. These include subsegments for the different function calls within the example
  • View Cloudwatch logs - Display the structured logging output of the example

Likewise, from the CloudWatch dashboard, under Metrics, all metrics, you will find the namespaces Another and ServerlessAirline. The values in each of these are published by the code in App.java.