Instantiate the Java Serverless Tracer

To instantiate the tracer, call the AppDynamics.getTracer(context) method. Place the method at the beginning of your function's entry point method.

The code snippet demonstrates how to instantiate the tracer:

@Override
    public void handleRequest(InputStream input, OutputStream output, Context context) throws IOException {
 
		//Instantiate the tracer.
  		Tracer tracer = AppDynamics.getTracer(context);
 
		//Your AWS Lambda function code begins here.
		int letter = 0;
        while((letter = input.read()) >= 0) {
            output.write(Character.toUpperCase(letter));
		}
    }