Open laurencefass opened 1 year ago
Hi @laurencefass have you tried with the version ^1.4.1
of the api package? Otel had some breaking changes in that version while the package was reaching stable status.
@pragmaticivan would it be possible to declare the list of peer dependencies for this project and add that to the package.json
? Both times i've tried to add this project to a nest project it is unclear when otel library versions to use.
If you install the most recent versions there are considerable type issues with the updated interfaces and your displayed examples.
See other errors as well:
@coler-j ,let me take a look, the reason why I didn't do that in the past was that OTEL metric SDK was not respecting version stability yet
but that's not the case anymore.
Meanwhile, that's an updated working project https://github.com/pragmaticivan/nestjs-otel-prom-grafana-tempo as example
I also think @opentelemetry/api
should be moved to peer dependencies. For example, in my project nestjs-otel
downloaded @opentelemetry/api@1.7.0
as a transitive dependency, but (since I also use the trace api directly for debugging) I also had @opentelemetry/api@1.6.0
install locally.
Since these dependencies were at different versions nestjs-otel
was not able to see the tracer and metric providers established by the other lib causing unknown failures.
If you want @pragmaticivan I can attempt to clear this up in a PR and also add more explicit wording around dependency selection then we can close the multiple issues that exist (and might stear people away from using this library).
The example for metrics generates a typescript error
package configuration:
Referring to this example
https://github.com/pragmaticivan/nestjs-otel#metric-service
import { Counter } from '@opentelemetry/api'; reports error
Im guessing this is another mismatch caused by updates to the api not yet updated here?
Thanks