Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request moves the implementation of CallContext and ScopedCallContext from the header call_context.h to opentelemetry_context.cc to reduce header dependencies. The review feedback highlights a critical ABI and ODR violation hazard introduced by forward-declaring OpenTelemetry types with conditional preprocessor checks in a public header. To resolve this, the reviewer recommends using std::any for type-erasing OTelContext in the header, along with corresponding updates using std::any_cast and including <any> in the source file.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16557 +/- ##
==========================================
- Coverage 92.35% 92.32% -0.03%
==========================================
Files 2262 2261 -1
Lines 217027 217045 +18
==========================================
- Hits 200425 200390 -35
- Misses 16602 16655 +53 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
google/cloud/stream_range.hincludesgoogle/cloud/internal/call_context.h, which previously includedopentelemetry_context.hand transitively pulled<opentelemetry/...>headers into every translation unit usingStreamRange<T>. This breaks builds that use Clang header modules and strict layering checks when OpenTelemetry headers are not modularized.Forward-declaring
opentelemetry::context::Contextincall_context.hand movingCallContext/ScopedCallContextout-of-line intoopentelemetry_context.ccavoids leaking OpenTelemetry headers throughcall_context.h.