Skip to content
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

Autoconfigure listener #5931

Merged

Conversation

jack-berg
Copy link
Member

Resolves #5862, #5021.

Add a new (experimental) interface called AutoConfigureListener. This is not a standalone SPI. Instead, implementations of existing SPIs can additionally implement AutoConfigureListener. By doing so, they get a callback to the autoconfigured OpenTelemetrySdk 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.

@jack-berg jack-berg requested a review from a team October 19, 2023 19:33
@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Files Coverage Δ
...ry/exporter/internal/grpc/GrpcExporterBuilder.java 95.40% <100.00%> (ø)
...ry/exporter/internal/http/HttpExporterBuilder.java 89.24% <100.00%> (ø)
...exporter/jaeger/JaegerGrpcSpanExporterBuilder.java 81.25% <100.00%> (ø)
...lp/http/metrics/OtlpHttpMetricExporterBuilder.java 95.74% <100.00%> (ø)
...r/otlp/internal/OtlpLogRecordExporterProvider.java 100.00% <100.00%> (ø)
...rter/otlp/internal/OtlpMetricExporterProvider.java 100.00% <ø> (ø)
...porter/otlp/internal/OtlpSpanExporterProvider.java 100.00% <100.00%> (ø)
...er/otlp/metrics/OtlpGrpcMetricExporterBuilder.java 100.00% <100.00%> (ø)
...elemetry/sdk/autoconfigure/internal/SpiHelper.java 100.00% <100.00%> (ø)
...lp/http/logs/OtlpHttpLogRecordExporterBuilder.java 92.10% <50.00%> (+0.67%) ⬆️
... and 4 more

📢 Thoughts on this report? Let us know!.

@jack-berg jack-berg added this to the 1.32.0 milestone Nov 3, 2023
@jack-berg jack-berg merged commit f2f3ab3 into open-telemetry:main Nov 9, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OTLP exporter error with non-global autoconfigured OpenTelemetry instance
2 participants