Instrument with TypeScript

To instrument your TypeScript 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.
    npm install appdynamics-lambda-tracer -–save
    npm install -D @types/aws-lambda esbuild
  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: APIGatewayEvent, context: Context): Promise<APIGatewayProxyResult> => {
    return {
    statusCode: 200,
    body: JSON.stringify({
    message: 'hello world',
    }),
    };
    });