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

fix(sdk-node): move @opentelemetry/exporter-jaeger to dev dependencies #4049

Merged
merged 2 commits into from Sep 13, 2023

Conversation

Vadman97
Copy link
Contributor

@Vadman97 Vadman97 commented Aug 9, 2023

Which problem is this PR solving?

@opentelemetry/sdk-node depends on @opentelemetry/exporter-jaeger despite never using it directly.
This increases the number of dependencies required to install @opentelemetry/sdk-node even if
@opentelemetry/exporter-jaeger is not used.

Fixes #3759

Short description of the changes

The change moves @opentelemetry/exporter-jaeger to the dev dependencies to resolve it in tests
but avoid requiring it for general usage of @opentelemetry/sdk-node. This is consistent with the
@opentelemetry/sdk-node documentation which states
that exporters must be explicit dependencies.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Locally building and testing the package after running npm install in opentelemetry-js/experimental/packages/opentelemetry-sdk-node.

Screenshot 2023-08-09 at 5 58 43 PM Screenshot 2023-08-09 at 5 58 08 PM

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added - N/A
  • Documentation has been updated - NA (already consistent)

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 9, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@Vadman97 Vadman97 marked this pull request as ready for review August 10, 2023 00:59
@Vadman97 Vadman97 requested a review from a team as a code owner August 10, 2023 00:59
@Vadman97 Vadman97 changed the title move @opentelemetry/exporter-jaeger to dev dependencies fix(sdk-node): move @opentelemetry/exporter-jaeger to dev dependencies Aug 10, 2023
@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Merging #4049 (09b7308) into main (4f28f90) will increase coverage by 0.01%.
The diff coverage is n/a.

❗ Current head 09b7308 differs from pull request most recent head 4c1dc82. Consider uploading reports for the commit 4c1dc82 to get more accurate results

@@            Coverage Diff             @@
##             main    #4049      +/-   ##
==========================================
+ Coverage   92.56%   92.57%   +0.01%     
==========================================
  Files         292      292              
  Lines        8178     8178              
  Branches     1692     1692              
==========================================
+ Hits         7570     7571       +1     
+ Misses        608      607       -1     

@Flarna
Copy link
Member

Flarna commented Aug 10, 2023

As you can see in the test run a changelog entry is needed.
Not sure if this should be marked as breaking. At least a clears statement in the changelog should me made that an explicit dependency is needed now. Maybe even improve the corresponding section in readme to make this clearer.

@Vadman97
Copy link
Contributor Author

Thank you @Flarna! Will add the changelog entry shortly and will update the readme as well.

@pichlermarc
Copy link
Member

Thank you for your contribution @Vadman97, removing this exporter has been long overdue 🙂

The exporter is lazy-required in sdk-node to allow sdk-node to work with bundling tools as the Jaeger exporter does not support them. We can remove it, but it will break users with the environment variable set.

const { JaegerExporter } = require('@opentelemetry/exporter-jaeger');

We'll also have to adapt the error message that the exporter has to be installed manually.

throw new Error(
`Could not instantiate JaegerExporter. This could be due to the JaegerExporter's lack of support for bundling. If possible, use @opentelemetry/exporter-trace-otlp-proto instead. Original Error: ${e}`
);

Previously we've gone the way of releasing a version that adds a postinstall script that alerts users that a feature will disappear in the next release (see #3833).

As @opentelemetry/sdk-node is widely used, I propose we do the same before merging this PR. It will delay this PR for a bit, but it will give users some advance notice that their telemetry will go missing when they update. 🤔

See also:

Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this; this looks good as-is 🙂

For lack of a better way to do it, I'm just using the "Changes Requested" state to block this until #4068 is merged and released (as mentioned in #4049 (comment)). Once we have it released, we can merge this PR 🙂

@pichlermarc pichlermarc added the Dependency on other PR This PR can't be merged because it has dependency on other PRs label Aug 16, 2023
@Vadman97
Copy link
Contributor Author

Thanks for your help @pichlermarc , and sorry for the delay here. I'm updating the branch now to change TracerProviderWithEnvExporter.ts as you described.

@Vadman97
Copy link
Contributor Author

@pichlermarc - is this ready to merge now that #4068 is in?

@pichlermarc
Copy link
Member

@pichlermarc - is this ready to merge now that #4068 is in?

Yes, but we still need to cut a release first to get #4068 out 🙂
I'm going to release 0.42.0 on Monday (trying not to release on Friday) - after that is done we can merge this in.

Sorry for the delay.

@erikshestopal
Copy link

@pichlermarc Seems like we can merge this PR since #4068 is out?

Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ready to merge now that the release it out.

@Vadman97 Vadman97 reopened this Sep 12, 2023
@pichlermarc pichlermarc merged commit 5615b1c into open-telemetry:main Sep 13, 2023
28 of 31 checks passed
@Vadman97
Copy link
Contributor Author

hey @pichlermarc , sorry to pester here - is there any estimate as to when the next version will be released to npm so that we can update our dependency on @opentelemetry/sdk-node?

@pichlermarc
Copy link
Member

The release with the warning message went out last week; I'd cut another release mid-next week.

@Vadman97
Copy link
Contributor Author

Vadman97 commented Oct 4, 2023

Hey @pichlermarc , any updates here on the next release being shipped?

@pichlermarc
Copy link
Member

@Vadman97 release PR is open at #4183

Vadman97 added a commit to highlight/highlight that referenced this pull request Oct 12, 2023
## Summary

References new opentelemetry dependencies with
open-telemetry/opentelemetry-js#4049 merged
Explicitly makes `@opentelemetry/exporter-jaeger` a dev dependency so
that consumers
do not reference it in their bundle.

## How did you test this change?

Local e2e app using yalc published SDK.

repro app is working correctly
https://discord.com/channels/1026884757667188757/1138948448507404338

![image](https://github.com/highlight/highlight/assets/1351531/31b87688-d2de-40dc-80cf-c7946b5a1eee)

## Are there any deployment considerations?

Changeset included.

## Does this work require review from our design team?

No
lewisl9029 pushed a commit to lewisl9029/highlight that referenced this pull request Nov 16, 2023
## Summary

References new opentelemetry dependencies with
open-telemetry/opentelemetry-js#4049 merged
Explicitly makes `@opentelemetry/exporter-jaeger` a dev dependency so
that consumers
do not reference it in their bundle.

## How did you test this change?

Local e2e app using yalc published SDK.

repro app is working correctly
https://discord.com/channels/1026884757667188757/1138948448507404338

![image](https://github.com/highlight/highlight/assets/1351531/31b87688-d2de-40dc-80cf-c7946b5a1eee)

## Are there any deployment considerations?

Changeset included.

## Does this work require review from our design team?

No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependency on other PR This PR can't be merged because it has dependency on other PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NodeSDK fails in strict mode with Legacy octal escape is not permitted in strict mode
5 participants