Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node autoinstrumentation image includes dev dependencies #2802

Closed
Zirak opened this issue Mar 31, 2024 · 0 comments · Fixed by #2803
Closed

Node autoinstrumentation image includes dev dependencies #2802

Zirak opened this issue Mar 31, 2024 · 0 comments · Fixed by #2803

Comments

@Zirak
Copy link
Contributor

Zirak commented Mar 31, 2024

Component(s)

auto-instrumentation

Describe the issue you're reporting

When building the node autoinstrumentation image, its devDepencencies are included:

# 60d37e18ce is HEAD at time of writing
$ docker run -it --rm --name otel-autoinstro-node -w /autoinstrumentation autoinstrumentation-nodejs:60d37e18ce /bin/sh

/autoinstrumentation # du -ahd2 | sort -h
[ ... ]
796.0K  ./node_modules/copyfiles
808.0K  ./node_modules/@hapi
840.0K  ./node_modules/resolve
1.1M    ./node_modules/path-scurry
1.9M    ./node_modules/rimraf
2.9M    ./node_modules/protobufjs
3.6M    ./node_modules/@types
3.7M    ./node_modules/@grpc
31.3M   ./node_modules/typescript
112.5M  ./node_modules/@opentelemetry
169.3M  .
169.3M  ./node_modules

Here's the result of building the image without typescript, typescript + rimraf, and finally all dev dependencies:

$ docker image ls --format 'table {{.Repository}} {{.Tag}} {{.Size}}'
autoinstrumentation-nodejs 60d37e18ce 272MB
autoinstrumentation-nodejs no-ts 208MB
autoinstrumentation-nodejs no-ts-rmrf 201MB
autoinstrumentation-nodejs no-dev 200MB

I'll open up a PR to remove these dependencies as part of the build. It seems like every PR must have a tracking issue alongside it, hence this issue; apologies if I misunderstood the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant