-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
Problem Statement
I’ve been really struggling to work out how to add instrumentation to an app built using aws-cdk-lib/aws-lambda-nodejs and NodejsFunction.
Basically this bundles up all the files using esbuild and puts them into an output directory and I have been trying to use '-import ./instrument.server.mjs' on NODE_OPTIONS, but to use this we then need to copy over instrument.server.mjs to the output folder. However this opens up a new problem wherbey there are missing node_modules.
Solution Brainstorm
Solutions I have tried:
- Copy over packages needed to a new
node_modulesfiolder - there is a chain of dependencies so this was not possible. - Copying the entire
node_modulesfolder - we have a monorepo with lots of packages so this is not really practical. - Bundle using
tsdown- this complains that there are non-JS packages which can’t be bundled.
Additional Context
Tip: React with 👍 to help prioritize this improvement. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
Metadata
Metadata
Assignees
Projects
Status
Waiting for: Community