#What are the differences between MetinSeylan/Nestjs-OpenTelemetry and pragmaticivan/nestjs-otel?
7 messages · Page 1 of 1 (latest)
I'm not super familiar with the first, but nestjs-otel does not do any instrumentation that should be done by conventional opentelemetry library.
https://www.npmjs.com/package/@opentelemetry/instrumentation-nestjs-core
^ It expects you to use this instead because as nestjs evolves, the opentelemetry will support it natively.
OpenTelemetry NestJS automatic instrumentation package.. Latest version: 0.33.2, last published: a month ago. Start using @opentelemetry/instrumentation-nestjs-core in your project by running npm i @opentelemetry/instrumentation-nestjs-core. There are 22 other projects in the npm registry using @opentelemetry/instrumentation-nestjs-core.
There's also a known problem when you don't do the instrumentation before NestJS start. The dependency tree is not able to enforce opentelemetry as the first package to be load, and you would actually want that to be the first thing before you import any library.
By using the method where you import instrumentation as the first thing, now you get a lot of auto instrumentation for many known nodejs libraries with https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node
Metapackage which bundles opentelemetry node core and contrib instrumentations. Latest version: 0.39.4, last published: 23 days ago. Start using @opentelemetry/auto-instrumentations-node in your project by running npm i @opentelemetry/auto-instrumentations-node. There are 192 other projects in the npm registry using @opentelemetry/auto-instrum...
I see it also says open telemetry metric SDK is not stable, but it is stable here: https://github.com/open-telemetry/opentelemetry-js
I do suggest you investigate both though, I can't point out differences as I've only used one of them in production 😹
Thanks for the detailed answer! 🙂