Skip to content

Conversation

@jack-berg
Copy link
Member

This is a refactor aimed at improving and standardizing the pattern for loading SDK extension plugins. The key tasks we need to do:

  • All SDK extension plugin types have exactly one entry. Validate this.
  • Some SDK extension plugins have well known types which are bundled in with the SDK - things like BatchSpanProcessor, SimpleSpanProcessor, ParentBasedSampler. Other types are well known but are in separate packages still in opentelemetry-java - things like OTLP exporters, zipkin exporter, jaeger sampler. Other types are custom and provided by external packages. We want to use the convenience of the well known model types when available. And load via SPI when we don't. In all cases, we want the pattern to be clean and consistent.

@jack-berg jack-berg requested a review from a team as a code owner December 31, 2025 23:19
@codecov
Copy link

codecov bot commented Dec 31, 2025

Codecov Report

❌ Patch coverage is 95.58011% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.15%. Comparing base (7b2161c) to head (87ff6a7).

Files with missing lines Patch % Lines
...incubator/fileconfig/ComposableSamplerFactory.java 73.68% 3 Missing and 2 partials ⚠️
...extension/incubator/fileconfig/SamplerFactory.java 94.59% 1 Missing and 1 partial ⚠️
...sion/incubator/fileconfig/MetricReaderFactory.java 93.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #7947   +/-   ##
=========================================
  Coverage     90.14%   90.15%           
+ Complexity     7467     7457   -10     
=========================================
  Files           834      835    +1     
  Lines         22586    22520   -66     
  Branches       2240     2220   -20     
=========================================
- Hits          20360    20302   -58     
+ Misses         1527     1519    -8     
  Partials        699      699           

☔ 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.

// We don't use the variable till later but call validate first to confirm there are not
// multiple samplers.
Map.Entry<String, DeclarativeConfigProperties> samplerKeyValue =
FileConfigUtil.validateSingleKeyValue(context, model, "composable sampler");
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems a little weird to just have a free-form string here as the "component name" parameter. Shouldn't this link directly to what field might be in the yaml, so it will be easier to debug when you do have a duplicate? Or at least something that will make it really obvious what might be duplicated so it's easy to find and correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah the error messaging throughout the declarative config implementation are lame right now in this respect. In the most recent java sig, @trask and I talked about extended DeclarativeConfigProperties to be to track the location of the node with respect to the document, and reference this location in error messages. This type of "document location context" is needed throughout for better error messages.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jkwatson
Copy link
Contributor

jkwatson commented Jan 2, 2026

The approach seems reasonable; just a couple of comments to maybe tighten things up a bit.

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