Instrument with ECMAScript Modules (ESM)

To instrument your ES6 lambda, you can install the Node.js Serverless Tracer using these steps:
  1. Run the following command to install the Node.js serverless tracer using npm during development for ES6.
    npm install appdynamics-lambda-tracer --save
  2. Run the following command to import the tracer:
    import tracer from "appdynamics-lambda-tracer";
    tracer.init();
  3. Instrument the Function with the Node.js Serverless Tracer.
    The code snippet below demonstrates how to instrument a serverless function with the tracer:
    export const handler = tracer.functionWrapper(async (event) => {
    // YOUR CODE HERE
    return "Hello World";
    });