-
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
Initialize file configuration #5399
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #5399 +/- ##
=========================================
Coverage 91.31% 91.31%
- Complexity 4978 4980 +2
=========================================
Files 554 554
Lines 14731 14735 +4
Branches 1376 1376
=========================================
+ Hits 13451 13456 +5
+ Misses 884 883 -1
Partials 396 396 ☔ View full report in Codecov by Sentry. |
implementation(project(":semconv")) | ||
compileOnly("com.sun.net.httpserver:http") | ||
|
||
// io.opentelemetry.sdk.extension.incubator.fileconfig | ||
implementation("com.fasterxml.jackson.core:jackson-databind") | ||
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml") |
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.
Will this eventually make jackson a hard dependency for the sdk or just this extension?
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.
jackson-databind
gets CVEs very often, I'd sleep better if we don't include it in the SDK (at some point); would jackson-jr
be able to handle the generated POJOs?
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 would likely eventually be merged into the autoconfigure module, rather than the SDK itself.
I can investigate jackson-jr
.
Also, there's the more hands on option of doing something like we do with YAML view configuration, where we use snake YAML to parse to a generic type, then extract the fields manually. Maybe we use jackson-databind / jackson-jr to prototype, and consider switching to the manual method when its looking more complete.
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.
Considering this is for configuration, which is likely only done at startup I feel we should go with a potentially less performant option and not use jackson in exchange for fewer dependencies and CVE exposure.
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.
It's less of the performance I'm worried about and more the additional complexity to manually do the parsing that jackson does automatically. Additionally, there is likely to be a fair amount of churn in the early versions of the configuration schema - I'm happy enough writing manual parsing code once, but won't sign up to rewrite the manual parsing code for each of the early iterations.
implementation(project(":semconv")) | ||
compileOnly("com.sun.net.httpserver:http") | ||
|
||
// io.opentelemetry.sdk.extension.incubator.fileconfig | ||
implementation("com.fasterxml.jackson.core:jackson-databind") | ||
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml") |
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.
jackson-databind
gets CVEs very often, I'd sleep better if we don't include it in the SDK (at some point); would jackson-jr
be able to handle the generated POJOs?
Alright it's been a while but I made a bunch of updates to this and I'd like us to seriously consider merging it. Notes:
The opentelemetry-configuration schema has come a long way since I opened this PR and its in a place where I can actually start implementing the logic to interpret a parsed model and turn it into functional SDK elements. I will start doing that in followup PRs. |
...r/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/ConfigurationReader.java
Outdated
Show resolved
Hide resolved
...c/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/ConfigurationReaderTest.java
Outdated
Show resolved
Hide resolved
@jkwatson any comments before I merge this? |
Lay the groundwork for future file configuration work. Some details:
opentelemetry-configuration
repoConfigurationReader
class which reads a YAMLInputStream
and returns the correspondingOpenTelemetryConfiguration
representation of it.We're defining the configuration schema iteratively in small PRs, but eventually a YAML config file might look something like this.
Our goal should be to provide functionality to parse the YAML, and interpret it to build an
OpenTelemetrySdk
instance. Eventually, we should plug this into the autoconfigure module so to provide an alternative to the environment variable based scheme.