You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Get this error in lambda when bundling with esbuild.
Steps to reproduce
Create a lambda function using CDK NodeJSFunction factory. Add layers and configure bundling with:
externalModules: [
"@opentelemetry/api",
"@opentelemetry/sdk-node",
"@opentelemetry/auto-instrumentations-node",
"@opentelemetry/exporter-metrics-otlp-http",
"@opentelemetry/sdk-metrics",
],
What did you expect to see?
Lambda starts
What did you see instead?
I see @opentelemetry/api error
What version of collector/language SDK version did you use?
opentelemetry-nodejs-0_12_0
What language layer did you use?
nodejs
Additional context
This used to work with opentelemetry-nodejs-0_11_0
The text was updated successfully, but these errors were encountered:
What error logs do you see about @opentelemetry/api?
And I guess, it is caused by the bundling of OTEL JS layer itself. Since OTEL JS layer is bundled in the latest release (to reduce coldstart delay significantly: #1679), you can't use OTEL packages from layer itself as they are bundled and not visible by import/require in your code.
So, what I suggest you is that for the OTEL packages you directly reference in your own code (for ex. @opentelemetry/api in your case), keep them in your bundle (not define them as external).
In summary, can you try by removing "@opentelemetry/api" from externalModules from your CDK bundle config?
Describe the bug
Get this error in lambda when bundling with esbuild.
Steps to reproduce
Create a lambda function using CDK NodeJSFunction factory. Add layers and configure bundling with:
externalModules: [
"@opentelemetry/api",
"@opentelemetry/sdk-node",
"@opentelemetry/auto-instrumentations-node",
"@opentelemetry/exporter-metrics-otlp-http",
"@opentelemetry/sdk-metrics",
],
What did you expect to see?
Lambda starts
What did you see instead?
I see @opentelemetry/api error
What version of collector/language SDK version did you use?
opentelemetry-nodejs-0_12_0
What language layer did you use?
nodejs
Additional context
This used to work with opentelemetry-nodejs-0_11_0
The text was updated successfully, but these errors were encountered: