Skip to content

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

Open
jack-berg wants to merge 1 commit into
open-telemetry:mainfrom
jack-berg:hide-experimental-props
Open

Solve experimental properties on stable APIs in declarative config generated pojos#8654
jack-berg wants to merge 1 commit 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

Status last refreshed: 2026-07-26 19:38:43 UTC.

  • Waiting on: Reviewers
  • Next step: Review the latest changes.

This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected.

@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.76749% with 140 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.50%. Comparing base (c464806) to head (eb05e77).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...onfigure/declarativeconfig/model/GrpcTlsModel.java 60.86% 6 Missing and 3 partials ⚠️
...larativeconfig/model/NameStringValuePairModel.java 55.55% 6 Missing and 2 partials ⚠️
...toconfigure/declarativeconfig/model/ViewModel.java 55.55% 6 Missing and 2 partials ⚠️
...ure/declarativeconfig/model/DistributionModel.java 40.00% 6 Missing ⚠️
...e/declarativeconfig/model/MetricProducerModel.java 45.45% 6 Missing ⚠️
...clarativeconfig/model/AttributeNameValueModel.java 75.00% 4 Missing and 1 partial ⚠️
...iveconfig/model/internal/SamplerModelAccessor.java 75.00% 5 Missing ⚠️
...gure/declarativeconfig/model/AggregationModel.java 86.20% 3 Missing and 1 partial ⚠️
...se2ExponentialBucketHistogramAggregationModel.java 80.00% 4 Missing ⚠️
...ure/declarativeconfig/model/MetricReaderModel.java 77.77% 4 Missing ⚠️
... and 29 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8654      +/-   ##
============================================
- Coverage     91.64%   91.50%   -0.15%     
- Complexity    10389    10610     +221     
============================================
  Files          1021     1024       +3     
  Lines         27379    28025     +646     
  Branches       3219     3224       +5     
============================================
+ Hits          25091    25643     +552     
- Misses         1558     1640      +82     
- Partials        730      742      +12     

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

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.

1 participant