This page describes requirements, download instructions, and an instrumentation overview for the Java Serverless Tracer.
Before You Begin
Ensure that your setup meets these requirements:
- Existing AWS Lambda functions implemented in Java
- Active Serverless APM for AWS Lambda subscription
- Splunk AppDynamics SaaS Controller >= 4.5.11
Instrumentation Overview
Instrumentation of Serverless APM for AWS Lambda consists of three steps:
- Declare a Dependency on the Java Serverless Tracer
- Choose an Instrumentation Method
- Automatic Tracer Instrumentation
- Manual Tracer Instrumentation
- Verify the Serverless Tracer instrumentation
Declare a Dependency on the Java Serverless Tracer
Splunk AppDynamics 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:
<dependency>
<groupId>com.appdynamics</groupId>
<artifactId>lambda-tracer</artifactId>
<version>20.03.1391</version>
</dependency>
JAVA
dependencies {
compile group: 'com.appdynamics', name: 'lambda-tracer', version: '20.03.1391'
}
JAVA
If you do not use Apache Maven or Gradle, contact AppDynamics to obtain the Serverless Tracer JAR file.
Instrumentation Options
You can instrument the tracer:
Automatic Tracer Instrumentation
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:
RequestStreamHandler
and RequestHandler
are predefined handlers provided by AWS. See AWS documentation.
Manual Tracer Instrumentation
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:
Manual tracer instrumentation requires you to perform these actions:
- Instantiate the tracer
- Create, start, and stop a transaction
- Locate a correlation header
- Report transaction errors
The AWS Lambda context object in Java, context,
is provided by AWS. See AWS documentation.
Synchronize the Tracer
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.