KEMBAR78
7181: Loading Compressor using ClassLoader configured through setServiceClassLoader by vasantteja · Pull Request #7428 · open-telemetry/opentelemetry-java · GitHub
Skip to content

Conversation

@vasantteja
Copy link
Contributor

Context

This PR aims to resolve ClassLoader issue from this bug ticket.

@vasantteja vasantteja requested a review from a team as a code owner June 18, 2025 02:56
@codecov
Copy link

codecov bot commented Jun 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.78%. Comparing base (cc2844d) to head (0cd6af7).
Report is 18 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7428      +/-   ##
============================================
+ Coverage     89.75%   89.78%   +0.02%     
- Complexity     6980     6998      +18     
============================================
  Files           797      798       +1     
  Lines         21165    21204      +39     
  Branches       2057     2058       +1     
============================================
+ Hits          18996    19037      +41     
+ Misses         1505     1503       -2     
  Partials        664      664              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

requireNonNull(compressionMethod, "compressionMethod");
Compressor compressor = CompressorUtil.validateAndResolveCompressor(compressionMethod);
Compressor compressor =
CompressorUtil.validateAndResolveCompressor(compressionMethod, serviceClassLoader);
Copy link
Member

Choose a reason for hiding this comment

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

Seems like we should move the call to CompressorUtil.validateAndResolveCompressor down to HttpExporterBuilder, GrpcExporterBuilder to avoid the clutter of keeping ClassLoader serviceClassLoader property.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for reviewing this. I agree with you and I am making the changes. Let me get back after wrap them up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jack-berg Let me know how the current version looks.

Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

Just one recommendation to declutter, but looks good. Thanks for working on this.

See also #7446 - after seeing this PR I realized that adding this logic still wouldn't allow autoconfigure users to be able to specify the class loader used to load the compressor. With this and #7446 we have a good holistic story.

@jack-berg jack-berg merged commit a7315c6 into open-telemetry:main Jun 27, 2025
29 checks passed
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.

2 participants