Skip to content

Solve experimental properties on stable APIs in declarative config generated pojos - #8654

Merged
jack-berg merged 4 commits into
open-telemetry:mainfrom
jack-berg:hide-experimental-props
Aug 12, 2026
Merged

Solve experimental properties on stable APIs in declarative config generated pojos#8654
jack-berg merged 4 commits into
open-telemetry:mainfrom
jack-berg:hide-experimental-props

Conversation

@jack-berg

Copy link
Copy Markdown
Member

Related to #8402.

This PR solves lingering problems with the declarative config generated pojos. With it, all the issues I know of related to the generated POJOs are resolved, unblocking stabilization of declarative config.

  1. Experimental properties have public getter / setter API surface area on stable types. This is a blocker for stabilizing.
  2. When a property is stabilized and a user continues to use the old */development version, is will be silently dropped from the parsed model.

How it solves these issues:

  • Every type with experimental properties now has a <Type>ModelAccessor class in io.opentelemetry.sdk.autoconfigure.declarativeconfig.model.internal. This contains generated, type safe accessors for setting / getting experimental types from the stable parent type.
  • Every getter now returns the */development version of its property if available and the stable version is not set.
  • Every type now has a @JsonAnySetter method withExtensionProperty(String name, @Nullable Object value) for handling JSON schema additionalProperties: true and experimental properties:
    • If name is equal to a known stable property after stripping /development suffix, log a warning to prefer the stable variant, convert value to the stable property type and save it.
    • If name corresponds to known experimental property, convert value to the experimental property type and save it.
    • If the type supports additionalProperties, save it.
    • Else, log a warning.

@jack-berg
jack-berg requested a review from a team as a code owner July 22, 2026 20:01
@jack-berg jack-berg changed the title Solve experimental properties with DC generated pojos Solve experimental properties on stable APIs in declarative config generated pojos Jul 22, 2026
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Jul 22, 2026

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-08-12 21:12 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.73913% with 246 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.26%. Comparing base (c464806) to head (4296950).
⚠️ Report is 42 commits behind head on main.

Files with missing lines Patch % Lines
...ure/declarativeconfig/model/MetricReaderModel.java 74.07% 5 Missing and 2 partials ⚠️
...larativeconfig/model/NameStringValuePairModel.java 74.07% 5 Missing and 2 partials ⚠️
...igure/declarativeconfig/model/PropagatorModel.java 65.00% 5 Missing and 2 partials ⚠️
...iveconfig/model/SimpleLogRecordProcessorModel.java 65.00% 5 Missing and 2 partials ⚠️
...larativeconfig/model/SimpleSpanProcessorModel.java 65.00% 5 Missing and 2 partials ⚠️
...iveconfig/model/TraceIdRatioBasedSamplerModel.java 65.00% 5 Missing and 2 partials ⚠️
...toconfigure/declarativeconfig/model/ViewModel.java 74.07% 5 Missing and 2 partials ⚠️
...gure/declarativeconfig/model/AggregationModel.java 89.47% 4 Missing and 2 partials ⚠️
.../declarativeconfig/model/AttributeLimitsModel.java 79.31% 4 Missing and 2 partials ⚠️
...clarativeconfig/model/AttributeNameValueModel.java 81.81% 4 Missing and 2 partials ⚠️
... and 42 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8654      +/-   ##
============================================
- Coverage     91.64%   91.26%   -0.38%     
- Complexity    10389    10459      +70     
============================================
  Files          1021     1006      -15     
  Lines         27379    28238     +859     
  Branches       3219     3564     +345     
============================================
+ Hits          25091    25771     +680     
- Misses         1558     1674     +116     
- Partials        730      793      +63     

☔ View full report in Codecov by Harness.
📢 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.

@jack-berg
jack-berg merged commit c9c1400 into open-telemetry:main Aug 12, 2026
51 of 54 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