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

[sdk/nodejs] Add explicit dependency on @opentelemetry/instrumentation #13278

Merged
merged 1 commit into from Jul 11, 2023

Conversation

justinvp
Copy link
Member

The Node.js SDK makes use of @opentelemetry/instrumentation directly in

import { registerInstrumentations } from "@opentelemetry/instrumentation";
, but it is not specified as an explicit dependency in package.json -- we're relying on the indirect dependency from @opentelemetry/instrumentation-grpc.

This can break monorepo setups using npm workspaces. If there is another version of @opentelemtry/instrumentation, it is not hoisted for use by the Pulumi program, resulting in pulumi crashing with error: Error: Cannot find module '@opentelemetry/instrumentation'.

This change fixes this by explicitly declaring the version of @opentelemetry/instrumentation the SDK needs in package.json.

Fixes #13104

The Node.js SDK makes use of `@opentelemetry/instrumentation` directly in https://github.com/pulumi/pulumi/blob/2a69c252410a2d6ffd0bf48dc2c215f51317da0c/sdk/nodejs/cmd/run/tracing.ts#L24, but it is not specified as an explicit dependency in `package.json` -- we're relying on the indirect dependency from `@opentelemetry/instrumentation-grpc`.

This can break monorepo setups using npm workspaces. If there is another version of `@opentelemtry/instrumentation`, it is not hoisted for use by the Pulumi program, resulting in pulumi crashing with `error: Error: Cannot find module '@opentelemetry/instrumentation'`.

This change fixes this by explicitly declaring the version of `@opentelemetry/instrumentation` the SDK needs in `package.json`.
@justinvp justinvp requested a review from a team June 24, 2023 23:33
@pulumi-bot
Copy link
Contributor

Changelog

[uncommitted] (2023-06-24)

Bug Fixes

  • [sdk/nodejs] Add dependency on @opentelemetry/instrumentation
    #13278

@justinvp
Copy link
Member Author

bors merge

@bors
Copy link
Contributor

bors bot commented Jul 11, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 6d2cbcb into master Jul 11, 2023
42 checks passed
@bors bors bot deleted the justin/opentelemetry branch July 11, 2023 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing explicit dependency on @opentelemetry/instrumentation in Node.js package
3 participants