open-telemetry / opentelemetry-js

OpenTelemetry JavaScript Client
https://opentelemetry.io
Apache License 2.0
2.75k stars 809 forks source link

Widen dependency ranges for related packages for instrumentation #4975

Open mydea opened 2 months ago

mydea commented 2 months ago

Related to https://github.com/open-telemetry/opentelemetry-js/issues/4815

I noticed that e.g. @opentelemetry/instrumentation-http or @opentelemetry/instrumentation-fetch all hard-depend on specific versions of e.g. @opentelemetry/instrumentation, core, semantic-conventions etc. Is this really desired?

Based on https://github.com/open-telemetry/opentelemetry-specification/blob/a03382ada8afa9415266a84dafac0510ec8c160f/specification/upgrading.md?plain=1#L97-L122, if I understand correctly, instrumentation should continue to work for following minor releases of core packages. By relaxing e.g. @opentelemetry/core dependencies to e.g. ^1.26.0 etc. we could make compatibility much easier. As of now, it can be pretty hard to update instrumentation.

FWIW all the instrumentation from opentelemetry-js-contrib seems to already do it that way.

If that seems OK (cc @pichlermarc who explained these concepts to me previously) and I am not misunderstanding something, I'd be happy to open a PR updating the version ranges accordingly.

TLDR: I would propose to change e.g. these dependencies in @opentelemetry/instrumentation-http:

"dependencies": {
    "@opentelemetry/core": "1.26.0",
    "@opentelemetry/instrumentation": "0.53.0",
    "@opentelemetry/semantic-conventions": "1.27.0",
    "semver": "^7.5.2"
  },

to

"dependencies": {
    "@opentelemetry/core": "^1.26.0",
    "@opentelemetry/instrumentation": "^0.53.0",
    "@opentelemetry/semantic-conventions": "^1.27.0",
    "semver": "^7.5.2"
  },

and do the same for all instrumentation packages in this monorepo.

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

mydea commented 2 days ago

This is still relevant I believe, I can also just open a PR for this.