Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OpenTelemetry dependencies #964

Merged
merged 10 commits into from
Dec 7, 2023
Merged

Conversation

unflxw
Copy link
Contributor

@unflxw unflxw commented Nov 28, 2023

Fix #928. The test dependencies are updated to make sure that this actually works.

Update OpenTelemetry dependencies

Update dependencies in our package-lock.json to newer versions.

Update the dependency bound for @opentelemetry/sdk-node to
^0.45.0 to ensure it brings in the fix for #928.

Add script to update test app dependencies

The test apps are at their most useful when testing against the
latest versions of our dependencies, which are the ones that will
be installed by default when running npm install @appsignal/nodejs.

Add a script to update the dependencies for all test apps at once.

Update test app dependencies

Update the package-lock.json dependencies on the test apps to
ensure that AppSignal works with the latest @opentelemetry/sdk-node.

@unflxw unflxw self-assigned this Nov 28, 2023
@unflxw unflxw added the chore label Nov 28, 2023
@backlog-helper
Copy link

backlog-helper bot commented Nov 28, 2023

✔️ All good!

New issue guide | Backlog management | Rules | Feedback

@tombruijn
Copy link
Member

@unflxw can you fix the build and add a changeset?

@unflxw unflxw force-pushed the update-opentelemetry-dependencies branch from 6878c50 to 12b31a9 Compare November 30, 2023 11:13
The test apps are at their most useful when testing against the
latest versions of our dependencies, which are the ones that will
be installed by default when running `npm install @appsignal/nodejs`.

Add a script to update the dependencies for all test apps at once.
@unflxw unflxw force-pushed the update-opentelemetry-dependencies branch 2 times, most recently from a91d24d to ac047d0 Compare November 30, 2023 16:53
Accidentally using several `@opentelemetry/api` minor versions,
which is almost inevitable due to how npm resolves dependencies,
triggers an absolutely deranged "feature" in the OpenTelemetry API
internals, by which the global tracer set by the OpenTelemetry API
version with the lower version number will not be visible by the
one with the higher version number, and an error message about it
will be logged to nowhere.

This is not helped by the fact that `@prisma/instrumentation` has a
hardcoded version bound, which they bump automatically for no reason
whatsoever.

Do a best-effort attempt to force OpenTelemetry versions to a
specific version range instead, by picking versions of the
instrumentations that are compatible with the `@opentelemetry/api`
minor version. This will hopefully trick OpenTelemetry into picking
versions that it can dedupe. Maybe. Who knows.

We'll have to remember to update this in the future, whenever the
release tracker tells us to.

If this breaks again in the future, let's tighten the version bounds
further.
Fix the bounds to point to `@appsignal/nodejs` version 3, and relax
the bounds on other dependencies.
@unflxw unflxw force-pushed the update-opentelemetry-dependencies branch from ac047d0 to 749cd3e Compare November 30, 2023 17:02
Update the `package-lock.json` files in the integration test apps
in order to bring in newer versions of their dependencies.
This ensures that the fix for #928 is present.
It might be best to let this dependency's version be picked
transitively via `@opentelemetry/sdk-trace-node`.
Because `npm link` transitive dependencies don't really work like
other transitive dependencies, add the `@opentelemetry/api`
dependency back to the `express-redis` integration test app, with
the same version bound as the one hardcoded in the package.json.

(Actual users of `@appsignal/nodejs` do not need to do this)
@unflxw unflxw force-pushed the update-opentelemetry-dependencies branch from 749cd3e to 6d3f4b1 Compare November 30, 2023 17:08
@unflxw
Copy link
Contributor Author

unflxw commented Nov 30, 2023

@tombruijn build fixed. Not sure what the changeset would be, this is just maintenance work.

@backlog-helper

This comment has been minimized.

1 similar comment
@backlog-helper

This comment has been minimized.

@tombruijn
Copy link
Member

@unflxw In this case it can be something like "Updated OpenTelemetry dependencies with fix for Next.js and Webpack compatability" and other important fixes we know these updates include.

@backlog-helper

This comment has been minimized.

2 similar comments
@backlog-helper

This comment has been minimized.

@backlog-helper
Copy link

backlog-helper bot commented Dec 7, 2023


This is a message from the daily scheduled checks.

New issue guide | Backlog management | Rules | Feedback

@tombruijn tombruijn force-pushed the update-opentelemetry-dependencies branch from 86a2c9e to 02dda5b Compare December 7, 2023 08:27
For some reason in the merge commit with the main branch it installed
the wrong versions of packages and I got a linter issue on one of the
files in the package. Rebuild the `package-lock.json` file (by removing
`node_modules` and `package-lock.json`, and running `npm install`) and
commit the result.
@tombruijn tombruijn merged commit 2cfc7ff into main Dec 7, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Next.js + Webpack incompatibility
2 participants