-
Notifications
You must be signed in to change notification settings - Fork 840
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
Declarative configuration missing pieces #6677
Changes from all commits
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 |
---|---|---|
|
@@ -123,8 +123,7 @@ | |
} | ||
|
||
/** | ||
* Convert the {@code model} to a generic {@link StructuredConfigProperties}, which can be used to | ||
* read configuration not part of the model. | ||
* Convert the {@code model} to a generic {@link StructuredConfigProperties}. | ||
* | ||
* @param model the configuration model | ||
* @return a generic {@link StructuredConfigProperties} representation of the model | ||
|
@@ -133,6 +132,17 @@ | |
return toConfigProperties((Object) model); | ||
} | ||
|
||
/** | ||
* Convert the {@code configuration} YAML to a generic {@link StructuredConfigProperties}. | ||
* | ||
* @param configuration configuration YAML | ||
* @return a generic {@link StructuredConfigProperties} representation of the model | ||
*/ | ||
public static StructuredConfigProperties toConfigProperties(InputStream configuration) { | ||
Object yamlObj = loadYaml(configuration, System.getenv()); | ||
return toConfigProperties(yamlObj); | ||
Check warning on line 143 in sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfiguration.java Codecov / codecov/patchsdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfiguration.java#L142-L143
|
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an essential test utility, allowing you to write chunks of YAML, convert them to StructuredConfigProperties, and call ComponentProvider, i.e. https://github.com/open-telemetry/opentelemetry-java-contrib/pull/1440/files#diff-3d0118f231281243bf34a7e7beb3809e7a6523e8ece8a17b83f1784953389ceb |
||
|
||
static StructuredConfigProperties toConfigProperties(Object model) { | ||
Map<String, Object> configurationMap = | ||
MAPPER.convertValue(model, new TypeReference<Map<String, Object>>() {}); | ||
|
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.
Without this, open-telemetry/opentelemetry-java-contrib#1440 is full of warnings like: