-
Notifications
You must be signed in to change notification settings - Fork 834
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
Changes from all commits
af278ba
9d00503
163dcd4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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; | ||
Check warning on line 29 in sdk-extensions/autoconfigure-spi/src/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/ExtendedConfigProperties.java Codecov / codecov/patchsdk-extensions/autoconfigure-spi/src/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/ExtendedConfigProperties.java#L29
|
||
} | ||
|
||
/** | ||
* 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; | ||
Check warning on line 43 in sdk-extensions/autoconfigure-spi/src/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/ExtendedConfigProperties.java Codecov / codecov/patchsdk-extensions/autoconfigure-spi/src/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/ExtendedConfigProperties.java#L43
|
||
} | ||
} |
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.