faro-web-sdk icon indicating copy to clipboard operation
faro-web-sdk copied to clipboard

Declare specified OTel package versions as a peer dependency to prevent problems caused by different versions

Open codecapitano opened this issue 2 years ago • 8 comments

Description

Using different OTel versions can cause problems if Faro would not used the version as specified.

Proposed solution

Declare respective packages as peer-dependencies

codecapitano avatar Oct 25 '23 11:10 codecapitano

Hey @codecapitano, do you have any updated on this?

I am having an issues with different versions of @opentelemetry packages in my build. When it was 1.2.0 version I had to add in package.json resolution the following:

{
  "resolutions": {
    "@opentelemetry/core": "1.15.2",
    "@opentelemetry/resources": "1.15.2",
    "@opentelemetry/semantic-conventions": "1.15.2",
    "@opentelemetry/sdk-trace-base": "1.15.2",
    "@opentelemetry/sdk-trace-web": "1.15.2"
  }

Now I switched to 1.2.8 faro and got one more complaint:

ERROR in @opentelemetry/instrumentation
  Multiple versions of @opentelemetry/instrumentation found:
    0.41.2 /builds/product/web-app/~/@opentelemetry/instrumentation from /builds/product/web-app/~/libjs-pdobservability/traces/traces.js
    0.44.0 /builds/product/web-app/~/@grafana/faro-web-tracing/~/@opentelemetry/instrumentation from /builds/product/web-app/~/@grafana/faro-web-tracing/dist/cjs/instrumentation.js

Memfisrain avatar Nov 22 '23 19:11 Memfisrain

And one more issue with dependency as I can see is:

  1. I would like to install "@grafana/faro-web-sdk": "1.2.4" and "@grafana/faro-web-tracing": "1.2.4"
  2. When I look into my node_modules I can see, that @grafana/faro-web-tracing installs it's own @grafana/[email protected]

That again trigger multiple versions of package error

Memfisrain avatar Nov 23 '23 08:11 Memfisrain

Hi @Memfisrain thanks for bumping this,

Will updat the otel deps in the web-tracing package and clean up our own resolutions (seems they cause problems with recent otel version and we don't need them anymore).

Also I'll declare the otel packages we use as peer deps.

You can track it here.

Unfortunately we will release the next Faro version after Black Friday or maybe even after Black Week.

Cheers, Marco

codecapitano avatar Nov 23 '23 16:11 codecapitano

Not actually fixed

SimenB avatar Nov 28 '23 13:11 SimenB

Not actually fixed

@SimenB can you give me a brief description. Is it still the problem with different package versions in a build?

codecapitano avatar Nov 28 '23 14:11 codecapitano

Title of issue is "use peer deps" - in that regard I don't think it should be considered completed. Dependency mismatch has been fixed, tho 👍

SimenB avatar Nov 28 '23 15:11 SimenB

Title of issue is "use peer deps" - in that regard I don't think it should be considered completed. Dependency mismatch has been fixed, tho 👍

Thank you Simen.

Yes good catch, it got auto closed because of the linked PR. Will reopen the issue.

codecapitano avatar Nov 28 '23 15:11 codecapitano

Quick heads up @Memfisrain and @SimenB. We released Faro v1.2.9 which contains the updated otel-deps in the web-tracing package.

codecapitano avatar Nov 29 '23 09:11 codecapitano