open-telemetry / opentelemetry-java

OpenTelemetry Java SDK
https://opentelemetry.io
Apache License 2.0
1.97k stars 814 forks source link

Use autoconfigured ClassLoader to load declarative config #6725

Closed jack-berg closed 1 week ago

jack-berg commented 1 week ago

Agent extensions aren't currently able to provide declarative configuration ComponentProvider SPI implementations because the agent requires a them to be loaded using a particular class loader.

This adds a new FileConfiguration#create overload which allows SpiHelper (which is based on a ClassLoader) to be specified, and updates AutoConfiguredOpenTelemetrySdkBuilder to call this new method.

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 95.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 90.06%. Comparing base (39b2411) to head (16a4e67). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...nfigure/AutoConfiguredOpenTelemetrySdkBuilder.java 90.90% 1 Missing :warning:
...ension/incubator/fileconfig/FileConfiguration.java 92.30% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6725 +/- ## ========================================= Coverage 90.06% 90.06% - Complexity 6457 6463 +6 ========================================= Files 718 718 Lines 19511 19528 +17 Branches 1922 1923 +1 ========================================= + Hits 17572 17588 +16 Misses 1350 1350 - Partials 589 590 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.