Skip to content

chore: decouple opentelemetry-proto from opentelemetry-sdk#3512

Open
scottgerring wants to merge 7 commits into
open-telemetry:mainfrom
scottgerring:sgg/proto-decouple
Open

chore: decouple opentelemetry-proto from opentelemetry-sdk#3512
scottgerring wants to merge 7 commits into
open-telemetry:mainfrom
scottgerring:sgg/proto-decouple

Conversation

@scottgerring
Copy link
Copy Markdown
Member

Summary

This refactors opentelemetry-proto so it only contains generated OTLP protobuf types. The diff is substantial because of the orphan rules - opentelemetry-otlp cannot implement the conversion traits for foreign types into foreign types. My feeling is that we just need to pull off the bandaid here!

The SDK/api-aware transform helpers have been moved into opentelemetry-otlp, where they are used by the exporters. This removes the direct opentelemetry / opentelemetry_sdk dependency from opentelemetry-proto and makes the crate usable by consumers that only need OTLP wire-format types. This will also provide other options to structure changes like #3460 , where we could benefit from having the dependency the other way around (although this is by no means a done deal).

Changes

  • Remove the public opentelemetry_proto::transform module.
  • Move SDK/API → OTLP protobuf transformation logic into a private opentelemetry-otlp::transform module.
  • Update OTLP exporters to use the local transform helpers.
  • Update opentelemetry-proto docs and changelog to describe the crate as generated protobuf types only.

Prior art / related work

This implements the SDK-decoupling part of:

@scottgerring scottgerring assigned lalitb and unassigned lalitb May 11, 2026
@scottgerring scottgerring requested a review from lalitb May 11, 2026 07:55
@scottgerring
Copy link
Copy Markdown
Member Author

@lalitb I know you've worked on this before; it would be great to get your high-level opinions on this so I can push it in the right direction. I'm not sure if i've missed some important nuance given this has come up a few times but never landed!

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 46.46617% with 356 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.0%. Comparing base (dfdc478) to head (ec5443d).

Files with missing lines Patch % Lines
opentelemetry-otlp/src/transform/metrics.rs 9.8% 202 Missing ⚠️
opentelemetry-otlp/src/transform/logs.rs 69.9% 68 Missing ⚠️
opentelemetry-otlp/src/transform/trace.rs 47.6% 45 Missing ⚠️
opentelemetry-otlp/src/transform/common.rs 74.3% 30 Missing ⚠️
opentelemetry-otlp/src/exporter/tonic/metrics.rs 0.0% 3 Missing ⚠️
opentelemetry-otlp/src/exporter/http/logs.rs 0.0% 2 Missing ⚠️
opentelemetry-otlp/src/exporter/http/trace.rs 0.0% 2 Missing ⚠️
opentelemetry-otlp/src/exporter/tonic/logs.rs 0.0% 2 Missing ⚠️
opentelemetry-otlp/src/exporter/tonic/trace.rs 0.0% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #3512     +/-   ##
=======================================
+ Coverage   82.8%   83.0%   +0.1%     
=======================================
  Files        130     129      -1     
  Lines      27289   27229     -60     
=======================================
- Hits       22622   22614      -8     
+ Misses      4667    4615     -52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@scottgerring scottgerring force-pushed the sgg/proto-decouple branch 2 times, most recently from 803374d to 4985d5c Compare May 12, 2026 07:07
@scottgerring scottgerring marked this pull request as ready for review May 12, 2026 07:15
@scottgerring scottgerring requested a review from a team as a code owner May 12, 2026 07:15
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.

2 participants