This page describes requirements, download instructions, and an instrumentation overview for the Java Serverless Tracer.
Ensure that your setup meets these requirements:
Instrumentation of Serverless APM for AWS Lambda consists of three steps:
provides Serverless APM functionality in the form of a tracer library.
Express your project's dependency on the Java Serverless Tracer using Apache Maven or Gradle as follows:
|
If you do not use Apache Maven or Gradle, contact AppDynamics to obtain the Serverless Tracer JAR file.
You can instrument the tracer:
Automatically, using class
MonitoredRequestStreamHandler
, or
AppDynamics.getTracer(context)
. You can automatically instrument the tracer if your function uses the RequestStreamHandler
interface.
In automatic instrumentation, your function inherits the tracer's configurations. Automatic instrumentation preconfigures the tracer to:
Create, start, and stop a transaction
RequestStreamHandler
and RequestHandler
are predefined handlers provided by AWS. See AWS documentation.
In manual tracer instrumentation, the method AppDynamics.getTracer(context)
instantiates the tracer at the beginning of your function's entry point method. Manually instrument the tracer if:
Your AWS Lambda function does not implement the RequestStreamHandler
interface.
MonitoredRequestStreamHandler
.Manual tracer instrumentation requires you to perform these actions:
The AWS Lambda context object in Java, context,
is provided by AWS. See AWS documentation.
For both instrumentation options, you should synchronize any access to the tracer.
In automatic instrumentation, you need to synchronize the transaction object returned by the getTransaction()
method.
In manual instrumentation, you need to synchronize the tracer object returned by the getTracer()
method. Manual tracer instrumentation is required for multi-threaded use of the tracer.
Amazon Web Services, the AWS logo, AWS, and any other AWS Marks used in these materials are trademarks of Amazon.com, Inc. or its affiliates in the United States and/or other countries.