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.
Resolves #5862, #5021.
Add a new (experimental) interface called
AutoConfigureListener
. This is not a standalone SPI. Instead, implementations of existing SPIs can additionally implementAutoConfigureListener
. By doing so, they get a callback to the autoconfiguredOpenTelemetrySdk
instance.Why have SPI implementations implement an additional interface instead of adding a new SPI? If we were to introduce a new standalone SPI, each SPI implementation that needs a callback would have to hold a reference to their configured SDK components in a static variable, and update those references with
OpenTelemetrySdk
in the callback.With the strategy in this PR, the same SPI implementation instance that configured the SDK component is invoked with the
OpenTelemetrySdk
, so it only has to hold class instance references to the configured SDK components.See
OtlpLogRecordExporterProvider
,OtlpSpanExporterProvider
for how this would work in practice.I figure we incubate this for a bit before committing to the API.
If we agree with this strategy, I can followup with another PR to update
ZipkinSpanExporterProvider
.