Skip to content

Latest commit

 

History

History
 
 

jaeger-java

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

OpenTracing and Jaeger in AWS Lambda Java 8 Runtime

This is an example of a simple, traced Lambda function using the Jaeger Java tracer with SignalFx. See RoulettePlayer.java for the example code.

Building and creating a Deployment Package

There are several accepted Java deployment packages for AWS Lambda and you should use the one best suited for your development environment: https://docs.aws.amazon.com/lambda/latest/dg/lambda-java-how-to-create-deployment-package.html In this example we use a standalone .jar that has been generated by Maven. To build this application and create the deployable archive follow these instructions from this document's parent directory:

$ pwd  # Confirm this is <your_local_path/tracing-examples/aws-lambda/jaeger-java>
$ mvn package

The resulting ./target/lambda-java-example.jar can be uploaded to S3 or in your browser via the AWS Console during function creation. Register your handler as example.RoulettePlayer::handleRequest and don't forget to set the SIGNALFX_INGEST_URL environment variable to point to your Gateway. You should be able verify the application with the following test event:

{
  "queryStringParameters": {
    "choice": "00"
  }
}

The execution result should succeed with a response similar to:

{
  "statusCode": 404,
  "body": "{\"TraceId\":\"2296bd21606fc2e4\",\"Result\":\"You Lost! The ball landed on 35.\",\"Choice\":\"00\"}"
}

Resources