obs-nebula / check-traces

The purpose of this repository is to ensure that a basic Express app's traces are correctly generated and successfully exported to the final destination which is the OpenTelemetry Collector
MIT License
1 stars 1 forks source link

Create a branch with OTEL meta-package for node (auto-instrumentations-node) #10

Closed helio-frota closed 1 year ago

helio-frota commented 1 year ago

OTEL-Js has a meta-package https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-node

This meta-package is using all the common packages as dependencies https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/metapackages/auto-instrumentations-node/package.json#L48

AFAIK s2i deployments uses production dependencies instead of devDependencies so it would be good for us to see the size of the app to be deployed when using a meta-package.

Other things:

helio-frota commented 1 year ago

Using the meta-package the app continues generating and sending traces to Jaeger with the following declared dependencies:

"dependencies": {
  "@opentelemetry/auto-instrumentations-node": "^0.36.0",
  "@opentelemetry/exporter-jaeger": "^1.9.0",
  "@opentelemetry/sdk-trace-node": "^1.9.0",
  "express": "^4.18.2"
}

Comparing with the main branch:

 "dependencies": {
  "express": "^4.18.2",
  "@opentelemetry/exporter-jaeger": "^1.9.0",
  "@opentelemetry/instrumentation": "^0.35.0",
  "@opentelemetry/instrumentation-express": "^0.32.0",
  "@opentelemetry/instrumentation-http": "^0.35.0",
  "@opentelemetry/resources": "^1.9.0",
  "@opentelemetry/sdk-trace-node": "^1.9.0",
  "@opentelemetry/semantic-conventions": "^1.8.0"
}

With no changes in the tracing.js file.

The size of the app after npm install

➜  check-traces git:(meta-package) ✗ du -s -h
374M    .
➜  check-traces git:(meta-package) ✗ cd ../tempa/check-traces/
➜  check-traces git:(main) du -s -h
40M .

I'm going to discard both:

Because we have other things to do instead of looking for problems related to dependencies (as things changed a bit after 3 weeks)

Nothing was changed in the tracing.js file and the app continues working as commented before. :v: Branch created: https://github.com/obs-nebula/check-traces/compare/main...meta-package

helio-frota commented 1 year ago
➜  check-traces git:(meta-package) ✗ du -s -h
374M    .
➜  check-traces git:(meta-package) ✗ cd ../tempa/check-traces/
➜  check-traces git:(main) du -s -h
40M .

This is not correct, I forgot the extracted Jaeger in the directory during the check!

helio-frota commented 1 year ago
➜  check-traces git:(main) rm -Rf node_modules/
➜  check-traces git:(main)
➜  check-traces git:(main) ls
img.png  index.js  LICENSE  package.json  package-lock.json  README.md  scripts/  tracing.js
➜  check-traces git:(main) npm install

added 115 packages, and audited 116 packages in 1s

11 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
➜  check-traces git:(main) du -s -h
37M .
➜  check-traces git:(main) rm -Rf node_modules/
➜  check-traces git:(main) git checkout meta-package
Switched to branch 'meta-package'
➜  check-traces git:(meta-package) ls
img.png  index.js  LICENSE  package.json  package-lock.json  README.md  scripts/  tracing.js
➜  check-traces git:(meta-package) npm install
npm WARN deprecated @types/generic-pool@3.8.1: This is a stub types definition. generic-pool provides its own type definitions, so you do not need this installed.
npm WARN deprecated @opentelemetry/api-metrics@0.32.0: Please use @opentelemetry/api >= 1.3.0

added 197 packages, and audited 198 packages in 777ms

11 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
➜  check-traces git:(meta-package) ls
img.png  index.js  LICENSE  node_modules/  package.json  package-lock.json  README.md  scripts/  tracing.js
➜  check-traces git:(meta-package) du -s -h
34M .
➜  check-traces git:(meta-package) ls node_modules/@opentelemetry/
api/                               instrumentation-dataloader/    instrumentation-lru-memoizer/  instrumentation-router/
api-metrics/                       instrumentation-dns/           instrumentation-memcached/     instrumentation-socket.io/
auto-instrumentations-node/        instrumentation-express/       instrumentation-mongodb/       instrumentation-tedious/
context-async-hooks/               instrumentation-fastify/       instrumentation-mongoose/      instrumentation-winston/
core/                              instrumentation-fs/            instrumentation-mysql/         propagation-utils/
exporter-jaeger/                   instrumentation-generic-pool/  instrumentation-mysql2/        propagator-aws-xray/
instrumentation/                   instrumentation-graphql/       instrumentation-nestjs-core/   propagator-b3/
instrumentation-amqplib/           instrumentation-grpc/          instrumentation-net/           propagator-jaeger/
instrumentation-aws-lambda/        instrumentation-hapi/          instrumentation-pg/            redis-common/
instrumentation-aws-sdk/           instrumentation-http/          instrumentation-pino/          resources/
instrumentation-bunyan/            instrumentation-ioredis/       instrumentation-redis/         sdk-trace-base/
instrumentation-cassandra-driver/  instrumentation-knex/          instrumentation-redis-4/       sdk-trace-node/
instrumentation-connect/           instrumentation-koa/           instrumentation-restify/       semantic-conventions/
➜  check-traces git:(meta-package) rm -Rf node_modules/
➜  check-traces git:(meta-package) git checkout main
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
➜  check-traces git:(main) ls
img.png  index.js  LICENSE  package.json  package-lock.json  README.md  scripts/  tracing.js
➜  check-traces git:(main) npm install

added 115 packages, and audited 116 packages in 1s

11 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
➜  check-traces git:(main) ls node_modules/@opentelemetry/
api/                  core/             instrumentation/          instrumentation-http/  propagator-jaeger/  sdk-trace-node/
context-async-hooks/  exporter-jaeger/  instrumentation-express/  propagator-b3/         resources/          semantic-conventions/
➜  check-traces git:(main) du -s -h
37M .