Skip to content

Cannot find module '@opentelemetry/api #1715

@deepcrawltech

Description

@deepcrawltech

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions