-
Notifications
You must be signed in to change notification settings - Fork 541
Simplify opentelemetry-proto: SDK decoupling and gRPC separation #3046
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
base: main
Are you sure you want to change the base?
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3046 +/- ##
=====================================
Coverage 80.0% 80.0%
=====================================
Files 126 126
Lines 21879 21879
=====================================
Hits 17519 17519
Misses 4360 4360 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: lalitb <1196320+lalitb@users.noreply.github.com>
Co-authored-by: lalitb <1196320+lalitb@users.noreply.github.com>
The CI is failing: error[E0433]: failed to resolve: could not find error[E0433]: failed to resolve: could not find error[E0433]: failed to resolve: could not find warning: unexpected warning: unexpected error[E0116]: cannot define inherent error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0308]: mismatched types Some errors have detailed explanations: E0116, E0117, E0277, E0308, E0433. |
Co-authored-by: lalitb <1196320+lalitb@users.noreply.github.com>
Fixed the import path issues causing the CI failure. The "could not find |
more errors @copilot : warning: unexpected Compiling ctor v0.2.9 error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound Some errors have detailed explanations: E0117, E0277. |
Co-authored-by: lalitb <1196320+lalitb@users.noreply.github.com>
Fixed the unexpected |
Still issue: error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound Some errors have detailed explanations: E0117, E0277. |
Addressing the orphan rule violations. The issue occurs because moving From implementations between opentelemetry-proto and opentelemetry-otlp creates situations where neither the source nor target types are local to the implementing crate. Converting problematic From implementations to standalone conversion functions to resolve these violations. |
…functions Co-authored-by: lalitb <1196320+lalitb@users.noreply.github.com>
…tions Co-authored-by: lalitb <1196320+lalitb@users.noreply.github.com>
CI failures: Compiling opentelemetry-otlp v0.30.0 (/home/runner/work/opentelemetry-rust/opentelemetry-rust/opentelemetry-otlp) error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound |
Try fixing again: error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound Some errors have detailed explanations: E0117, E0277. |
Co-authored-by: lalitb <1196320+lalitb@users.noreply.github.com>
Fixed the compilation errors. Removed the unused ExportMetricsServiceRequest import and converted all remaining From implementations in tracez.rs to standalone conversion functions to resolve orphan rule violations. The code now builds successfully with only warnings. Commit 2c211e3. |
This PR refactors the
opentelemetry-proto
crate to improve clarity, reduce unnecessary dependencies, and simplify usage for consumers of just the OTLP types.🔄 Key Changes
1. SDK Decoupling Achieved ✅
opentelemetry-sdk
as a dependency ofopentelemetry-proto
impl From<Resource> for proto::*
) toopentelemetry-otlp
opentelemetry-proto
now contains only wire format definitions2. Feature Flag Simplification ✅
gen-tonic-messages
feature flag as it's no longer neededprost
feature is enabledgen-tonic
feature now controls both protobuf messages and gRPC service definitions3. Transform Logic Relocation ✅
opentelemetry-proto/src/transform/
toopentelemetry-otlp/src/transform/
opentelemetry-otlp
📦 Before/After
Before:
After:
✅ Benefits
opentelemetry-proto
: Wire format types onlyopentelemetry-otlp
: SDK integration + transform logic🔧 API Impact
The core protobuf types remain unchanged and accessible. Some internal transform APIs may require updates due to Rust orphan rule constraints when moving implementations across crates.
🧪 Testing
opentelemetry-proto
builds without SDK dependenciesprost
featureopentelemetry-otlp
Fixes #3045.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.