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(exporter-jaeger): lazy require jaeger-client #3728

Conversation

pichlermarc
Copy link
Member

@pichlermarc pichlermarc commented Apr 13, 2023

Which problem is this PR solving?

The JaegerExporter currently does not support running in bundled environments, as requiring jaeger-client loads .thrift files from the file system. This causes problems in @opentelemetry/sdk-node as the JaegerExporter is required even though it is not being used (see #3521).

To circumvent this problem, this PR changes the approach of always requireing jaeger-client to do it once the constructor is actually called. Further added documentation to clarify that bundling is not supported with this package.

This PR does not add support for running the JaegerExporter in a bundled environment.

Fixes #3521

Type of change

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

How Has This Been Tested?

Alternatives I have considered

  • Pulling in relevant code from jaeger-client and pre-generating JS code from the .thrift files.
    • I decided against doing this as it would increase the maintenance burden on this repo, and would require significantly more work to get right.
  • Removing the JaegerExporter from sdk-node
    • The sdk-node package is deprecated, but I decided against doing this as it would break existing JaegerExporter users of the sdk-node package without warning.

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

@codecov
Copy link

codecov bot commented Apr 13, 2023

Codecov Report

Merging #3728 (034bc46) into main (053acb6) will increase coverage by 0.00%.
The diff coverage is 94.66%.

❗ Current head 034bc46 differs from pull request most recent head 25b07f0. Consider uploading reports for the commit 25b07f0 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3728   +/-   ##
=======================================
  Coverage   93.44%   93.44%           
=======================================
  Files         290      290           
  Lines        8845     8849    +4     
  Branches     1834     1834           
=======================================
+ Hits         8265     8269    +4     
  Misses        580      580           
Impacted Files Coverage Δ
...ackages/opentelemetry-exporter-jaeger/src/types.ts 100.00% <ø> (ø)
...ges/opentelemetry-exporter-jaeger/src/transform.ts 93.93% <93.65%> (+0.60%) ⬆️
...ckages/opentelemetry-exporter-jaeger/src/jaeger.ts 95.06% <100.00%> (+0.12%) ⬆️

@pichlermarc pichlermarc marked this pull request as ready for review April 17, 2023 08:29
@pichlermarc pichlermarc requested a review from a team as a code owner April 17, 2023 08:29
@Flarna
Copy link
Member

Flarna commented Apr 18, 2023

Would it be possible to require the whole jaeger exporter lazy from @opentelemetry/sdk-node instead? E.g. only require that one actually configured instead all of them.

@pichlermarc
Copy link
Member Author

Would it be possible to require the whole jaeger exporter lazy from @opentelemetry/sdk-node instead? E.g. only require that one actually configured instead all of them.

@Flarna Yes - I overlooked that this could also be an approach, and it's actually way more straightforward than this one here. I opened #3739 instead and will close this PR. Thanks for pointing this out 🙂

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.

Can't update to @opentelemetry/sdk-node v0.34.0 using esbuild
2 participants