-
Notifications
You must be signed in to change notification settings - Fork 858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extended config properties #5912
Closed
jack-berg
wants to merge
3
commits into
open-telemetry:main
from
jack-berg:extended-config-properties
Closed
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
af278ba
Add ExtendedConfigProperties to access complex types from file config…
jack-berg 9d00503
Add getConfigProperties implementation to DefaultConfigProperties
jack-berg 163dcd4
Merge branch 'main' of https://github.com/open-telemetry/opentelemetr…
jack-berg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
45 changes: 45 additions & 0 deletions
45
...c/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/ExtendedConfigProperties.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.sdk.autoconfigure.spi.internal; | ||
|
||
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; | ||
import java.util.List; | ||
import javax.annotation.Nullable; | ||
|
||
/** | ||
* An extended version of {@link ConfigProperties} that supports accessing complex types - nested | ||
* maps and arrays of maps. {@link ExtendedConfigProperties} is used as a representation of a map, | ||
* since it has (type safe) accessors for string keys. | ||
*/ | ||
public interface ExtendedConfigProperties extends ConfigProperties { | ||
|
||
/** | ||
* Returns a map-valued configuration property, represented as {@link ExtendedConfigProperties}. | ||
* | ||
* @return a map-valued configuration property, or {@code null} if {@code name} has not been | ||
* configured. | ||
* @throws io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException if the property is not a | ||
* map | ||
*/ | ||
@Nullable | ||
default ExtendedConfigProperties getConfigProperties(String name) { | ||
return null; | ||
} | ||
|
||
/** | ||
* Returns a list of map-valued configuration property, represented as {@link | ||
* ExtendedConfigProperties}. | ||
* | ||
* @return a list of map-valued configuration property, or {@code null} if {@code name} has not | ||
* been configured. | ||
* @throws io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException if the property is not a | ||
* list of maps | ||
*/ | ||
@Nullable | ||
default List<ExtendedConfigProperties> getListConfigProperties(String name) { | ||
return null; | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
32 changes: 0 additions & 32 deletions
32
...rc/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/ConfigurationReader.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to provide a way to deactivate
OTEL_CONFIG_FILE
config loading if the properties supplier is being used directly in the Autoconfiguration.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unrelated to this PR. Its already possible to deactivate
OTEL_CONFIG_FILE
via property suppliers. See the source code for howOTEL_CONFIG_FILE
is loaded. Its accessed viaConfigProperties.getString("otel.config.file")
using aConfigProperties
instance that is resolved using all the property suppliers and customizers typical in autoconfigure.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is unrelated with the PR but is of the upmost importance and should be clarified. From what I can see in the code, if the file exists, the programatic interface to create the SDK is not available anymore. This is a big problem.