Copy ConfigProperties, ConfigurationException to opentelemetry-sdk-co… #5500
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.
In the 6/1 Java SIG we discussed an alternative to opentelemetry-java-instrumentation#8604 in which the environment resource logic and EnvironmentResourceProvider implementation of ResourceProvider SPI are moved
opentelemetry-sdk-common
. The argument is that having this logic in the core of the SDK is more aligned with the spec language.The prerequisite of that is that we ConfigProperties, ConfigurationException to
opentelemetry-sdk-common
to avoid the circular dependency::sdk:common
->:sdk-extensions:autoconfigure-spi
->:sdk:common
This PR shows what moving ConfigProperties, ConfigurationException looks like. Here's a summary:
:sdk:common
:sdk-extensions:autoconfigure-spi
version of ConfigProperties to extend the:sdk:common
ConfigProperties. Override all the methods, retaining the same contracts, to keep japicmp happy.:sdk-extensions:autoconfigure-spi
. This implements the:sdk-extensions:autoconfigure-spi
version of ConfigurationProperties, and accepts the:sdk:common
as a delegate.It feels a bit strange to have two interfaces named ConfigProperties, and that the SPI interfaces accept the
:sdk-extensions:autoconfigure-spi
version to maintain backwards compatibility. But this should be a transparent change for users, as long as they're not using the internal DefaultConfigurationProperties class.WDYT? Is the payoff of having the environment resource more appropriately placed in
:sdk:common
enough to justify the awkwardness of having two identicalConfigurationProperties
interfaces?