See: Description
Package | Description |
---|---|
com.appoptics.awslambda |
Obtains the
io.opentelemetry.trace.Tracer |
com.appoptics.awslambda.handler |
Enables AppOptics instrumentation for java functions in AWS Lambda.
|
com.appoptics.awslambda.wrapper.httpclient.apache |
Enables AppOptics instrumentation for outbound http requests by Apache HTTP Client
|
There are 2 ways to enable our instrumentation:
com.amazonaws.services.lambda.runtime.RequestHandler
or com.amazonaws.services.lambda.runtime.RequestStreamHandler
TracedRequestHandler
/TracedRequestStreamHandler
instead of
com.amazonaws.services.lambda.runtime.RequestHandler/com.amazonaws.services.lambda.runtime.RequestStreamHandler
handleRequest
to doHandleRequest
import com.appoptics.awslambda.handler.TracedRequestHandler;
public class MyHandler implements TracedRequestHandler<APIGatewayV2ProxyRequestEvent, APIGatewayV2ProxyResponseEvent> { //replaced RequestHandler with TracedRequestHandler
public APIGatewayV2ProxyResponseEvent doHandleRequest(APIGatewayV2ProxyRequestEvent input, Context context) { //renamed from handleRequest
//...
}
}
HandlerInstrumentor
import com.appoptics.awslambda.handler.HandlerInstrumentor;
public class MyHandler {
public Output myMethod(Input input, Context context) throws IOException { //method signature unchanged
return HandlerInstrumentor.instrumentChecked(input, context, getClass(), () -> {
// original code logic that might throw IOException...
}
}
}
For configuration options, please refer to Java AWS Lambda configuration Copyright © 2020. All rights reserved.