Dynamic Languages (Node.JS, Python, PHP, C/C++, Webserver Agent)

cancel
Showing results for 
Search instead for 
Did you mean: 

How do we implement the Serverless tracer in an ES 6 module environment?

Highlighted

How do we implement the Serverless tracer in an ES 6 module environment?

We have the following code in our application:

 

import awsServerlessExpress from 'aws-serverless-express';
import tracer from 'appdynamics-lambda-tracer';

tracer.init(...);

...

handler = (event, context, callback) => {
  awsServerlessExpress.proxy(server, event, context);
};

tracer.mainModule(module);

 

It seems we cannot provide the `mainModule` function the CommonJS `module` object because this doesn't exist in an ES 6 environment (at least as the `mainModule` expects it in a CommonJS runtime environment).

 

Our question: How do we implement the Serverless tracer in an ES 6 module environment? Are there any code samples to help us?

 

Thanks!

How do we implement the Serverless tracer in an ES 6 module environment?