Extract declarative config to new opentelemetry-sdk-extension-decelar…#8265
Extract declarative config to new opentelemetry-sdk-extension-decelar…#8265jack-berg wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8265 +/- ##
=========================================
Coverage 90.29% 90.29%
Complexity 7656 7656
=========================================
Files 844 844
Lines 23071 23071
Branches 2311 2311
=========================================
Hits 20832 20832
Misses 1521 1521
Partials 718 718 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ative-config module
eb396e1 to
b60c2eb
Compare
robsunday
left a comment
There was a problem hiding this comment.
Looks good with some minor comments
| private static final boolean DECLARATIVE_CONFIG_AVAILABLE; | ||
|
|
||
| static { | ||
| boolean incubatorAvailable = false; |
There was a problem hiding this comment.
It would be good to rename it to declarativeConfigAvailable
| compileOnly(project(":api:incubator")) | ||
| compileOnly(project(":sdk-extensions:incubator")) | ||
| compileOnly(project(":sdk-extensions:declarative-config")) | ||
| // compileOnly(project(":sdk-extensions:incubator")) |
There was a problem hiding this comment.
Commented line could be removed
| * Utilities for interacting with ({@code | ||
| * io.opentelemetry:opentelemetry-sdk-extension-declarative-config}, which is not guaranteed to be | ||
| * present on the classpath. For all methods, callers MUST first separately reflectively confirm | ||
| * that the incubator is available on the classpath. |
There was a problem hiding this comment.
Comment needs to be updated because it mentions incubator
zeitlinger
left a comment
There was a problem hiding this comment.
Root package is io.opentelemetry.sdk.declarativeconfig - not io.opentelemetry.sdk.declarative.config as pr body says.
I do want to try out the opentelemetry-sdk-extension-autoconfigure alternative in a different PR. Will link here when done.
| |-------------------------------------------------------------------------------|------------------------------------------------------------------------------------|-----------------------------------------------------|-------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| | [SDK Autoconfigure](./sdk-extensions/autoconfigure) | Autoconfigure OpenTelemetry SDK from env vars, system properties, and SPI | `opentelemetry-sdk-extension-autoconfigure` | <!--VERSION_STABLE-->1.60.1<!--/VERSION_STABLE--> | [](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-extension-autoconfigure) | | ||
| | [SDK Autoconfigure SPI](./sdk-extensions/autoconfigure-spi) | Service Provider Interface (SPI) definitions for autoconfigure | `opentelemetry-sdk-extension-autoconfigure-spi` | <!--VERSION_STABLE-->1.60.1<!--/VERSION_STABLE--> | [](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-extension-autoconfigure-spi) | | ||
| | [SDK Declarative Config](./sdk-extensions/jaeger-remote-sampler) | Declarative config implementation for YAML-based SDK configuration | `opentelemetry-sdk-extension-declarative-config` | TODO: add after first release | TODO: add after first release | |
There was a problem hiding this comment.
| | [SDK Declarative Config](./sdk-extensions/jaeger-remote-sampler) | Declarative config implementation for YAML-based SDK configuration | `opentelemetry-sdk-extension-declarative-config` | TODO: add after first release | TODO: add after first release | | |
| | [SDK Declarative Config](./sdk-extensions/declarative-config) | Declarative config implementation for YAML-based SDK configuration | `opentelemetry-sdk-extension-declarative-config` | TODO: add after first release | TODO: add after first release | |
Here it is: #8270 That new PR has the advantage that it keeps the yaml deps optional. |
Resolves #7292
Extract declarative config from
opentelemetry-sdk-extension-incubatortoopentelemetry-sdk-extension-declarative-config.Root package at
io.opentelemetry.sdk.declarative.config.Other options considered:
opentelemetry-sdk-config- I.e. make declarative config a peer ofopentelemetry-sdk-{signal}. The existence ofSdkConfigProvider- which currently resides inopentelemetry-sdk-allsuggests this should be the case. However, declarative config requires dependencies on each of the otheropentelemetry-sdk-{signal}modules, and has a YAML dependency which we'll want to keep opt in.opentelemetry-sdk-extension-autoconfigure- I.e. extend existing autoconfigure with declarative config. I don't hate this idea, but it would mean adding a YAML dependency to autoconfigure. As it stands currently and with this PR, autoconfigure has a compileOnly dependency on declarative config where the behavior changes at runtime if available, i.e. we start looking forOTEL_CONFIG_FILEbeing set and if so delegating config to declarative config.Coming in a followup PRs:
org.snakeyaml:snakeyaml-enginefor parse input YAML string toObject, then we use jackson to convertObjecttoOpenTelemetryConfigurationModel. Iforg.snakeyaml.snakeyaml-enginehad unsolved vulnerabilities or if breaking changes caused runtime errors from the diamond dependency problem, then users would have no recourse. We could make these functions pluggable via SPI and try to provide at least one other implementation.