-
Notifications
You must be signed in to change notification settings - Fork 502
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
feat: OTLP Exporter builders to return specific Error type #2790
base: main
Are you sure you want to change the base?
feat: OTLP Exporter builders to return specific Error type #2790
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2790 +/- ##
=======================================
+ Coverage 79.6% 80.1% +0.5%
=======================================
Files 124 123 -1
Lines 23174 23191 +17
=======================================
+ Hits 18456 18591 +135
+ Misses 4718 4600 -118 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR refactors the OTLP Exporter builders to return a well-defined error type (ExporterBuildError) instead of a generic or signal‐specific error, thereby improving error handling clarity and consistency. It also removes an unused Error enum from the Log SDK and updates tests, examples, and changelogs to reflect these breaking changes.
- Update error type definitions and conversions across tonic and http exporters.
- Remove the unused Log SDK error enum.
- Adjust tests, examples, and changelogs to document the breaking changes.
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
opentelemetry-otlp/src/exporter/tonic/mod.rs | Updated error conversions and function signatures to use ExporterBuildError. |
opentelemetry-otlp/src/exporter/mod.rs | Updated error handling in trait implementations and FromStr. |
opentelemetry-otlp/src/exporter/http/mod.rs | Switched error type to ExporterBuildError and added a TODO for thread-spawn handling. |
opentelemetry-sdk/CHANGELOG.md & opentelemetry-otlp/CHANGELOG.md | Documented breaking changes for the new error handling approach. |
Various exporter and span modules, examples, and tests | Modified build functions and tests to accommodate the updated error type. |
Comments suppressed due to low confidence (1)
opentelemetry-otlp/src/exporter/http/mod.rs:171
- Consider handling errors from thread spawning instead of using unwrap, to prevent potential panics. Propagate a proper ExporterBuildError instead of unwrapping the thread result.
.join().unwrap(), // TODO: Return ExporterBuildError::ThreadSpawnFailed
Fixes #2561
Also removes now unused Error enum from Log SDK. Another set of cleanup required to clean Metrics, Traces completely.
Also, the newly introduced enum ExporterBuildError is not fully refined, this can be done in follow ups. This is necessary to unblock Log SDK Stable Release.
Note: This is a breaking change for OTLP Exporter, however, the impact is minimal (most users/examples simply unwrap/expect the Result instead of matching on it.), as described in the changelog, so I propose to make the change even though OTLP Exporter is marked RC.