Add contrib-facing helpers to the declarative config bridge#19220
Merged
Conversation
…BackedConfigProvider options - Enhance ConfigPropertiesBackedConfigProvider with Builder for custom mappings - Refactor ConfigPropertiesBackedDeclarativeConfigProperties to support mappings - Deprecate DeclarativeConfigPropertiesBridge - Addresses issue open-telemetry#15811
- Fix ConfigPropertiesBackedConfigProvider compilation warnings - Fix Spotless formatting violations in all bridge files - Suppress deprecation warnings in backward compatibility tests
The spring-boot-autoconfigure and javaagent-tooling modules need to continue using the deprecated DeclarativeConfigPropertiesBridge API to maintain backward compatibility during the transition period. This commit adds @SuppressWarnings annotations with explanatory comments and compiler flags to suppress deprecation warnings.
# Conflicts: # declarative-config-bridge/src/test/java/io/opentelemetry/instrumentation/config/bridge/ConfigPropertiesBackedDeclarativeConfigPropertiesTest.java
# Conflicts: # declarative-config-bridge/src/test/java/io/opentelemetry/instrumentation/config/bridge/ConfigPropertiesBackedDeclarativeConfigPropertiesTest.java
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds contrib-facing configuration bridge APIs for custom flat-property prefixes and shared duration parsing.
Changes:
- Adds configurable access paths and custom mappings.
- Adds duration parsing across flat and declarative configurations.
- Documents and tests the new APIs.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
declarative-config-bridge/README.md |
Documents bridge usage and duration parsing. |
ConfigPropertiesBackedConfigProvider.java |
Adds the configurable builder API. |
ConfigPropertiesBackedDeclarativeConfigProperties.java |
Supports mappings and custom prefixes. |
DeclarativeConfigPropertiesDurationUtil.java |
Adds shared duration parsing. |
ConfigPropertiesBackedConfigProviderTest.java |
Tests builder behavior. |
ConfigPropertiesBackedDeclarativeConfigPropertiesTest.java |
Tests custom and built-in mappings. |
DeclarativeConfigPropertiesDurationUtilTest.java |
Tests duration behavior by configuration source. |
Pull request dashboard statusStatus last refreshed: 2026-07-20 23:34:11 UTC.
This automated status or its linked feedback items may be incorrect. If something looks wrong, report it with the result you expected. |
zeitlinger
commented
Jul 14, 2026
|
|
||
| private final ConfigProperties configProperties; | ||
| private final List<String> path; | ||
| private final Map<String, String> mappings; |
Member
Author
There was a problem hiding this comment.
not sure if it makes sense to extract an object that contains all of those properties (all but path)
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
…ridge limitations
# Conflicts: # CHANGELOG.md # instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/OpenTelemetryAutoConfiguration.java
trask
approved these changes
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15811
Expose flat
ConfigPropertiesthrough the declarative configuration APIs so instrumentation and external components can use the same root-relative configuration shape regardless of the source.DeclarativeConfigBridge.createInstrumentationConfig(...)for the complete instrumentation configuration.DeclarativeConfigBridge.createComponentProperties(...)for a component-local flat-property prefix.DeclarativeConfigDurationUtil.getDuration(...)to share duration reads; flatConfigPropertiesinputs support duration strings such as42ms, while other declarative implementations provide integer milliseconds.ConfigPropertiesBackedConfigProviderin favor ofDeclarativeConfigBridge, and deprecateDeclarativeConfigPropertiesBridgeBuilderin favor of readingDeclarativeConfigPropertiesdirectly.Component-local reads retain the bridge's existing snake-case-to-kebab-case translation. The standard SDK flat configuration normalizes hyphens to periods, preserving existing dotted contrib properties such as
otel.inferred.spans.backup.diagnostic.filesandotel.inferred.spans.min.durationwithout introducing a component-specific naming rule.The draft contrib migration in open-telemetry/opentelemetry-java-contrib#2988 will be updated separately to consume these final APIs. This supersedes #15835.