-
Notifications
You must be signed in to change notification settings - Fork 427
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
Fix lifetime for sdk::ReadWriteLogRecord #3147
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for opentelemetry-cpp-api-docs canceled.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3147 +/- ##
==========================================
+ Coverage 87.86% 87.89% +0.03%
==========================================
Files 195 196 +1
Lines 6151 6339 +188
==========================================
+ Hits 5404 5571 +167
- Misses 747 768 +21
|
struct MixedAttributeMapStorage | ||
{ | ||
std::unordered_map<std::string, opentelemetry::common::AttributeValue> attributes; | ||
AttributeMap owened_attributes; |
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.
Looks like a typo:
AttributeMap owened_attributes; | |
AttributeMap owned_attributes; |
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.
Thanks, it's fixed now.
I don't know if this is critical, but this change breaks the ABI:
To reproduce: cmake -B build -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_FLAGS="-Og -g3" --fresh
cmake --build build -j$(nproc) --clean-first
cmake --install build --prefix ORIG
wget https://patch-diff.githubusercontent.com/raw/open-telemetry/opentelemetry-cpp/pull/3147.diff
patch -p1 < 3147.diff
cmake --build build -j$(nproc)
cmake --install build --prefix NEW
mkdir dumps
for i in ORIG/lib/*.so; do abi-dumper "$i" -o "dumps/orig-$(basename "$i").dump" -lver orig; done
for i in NEW/lib/*.so; do abi-dumper "$i" -o "dumps/new-$(basename "$i").dump" -lver new; done
for i in NEW/lib/*.so; do abi-compliance-checker -l "$(basename "$i")" -old "dumps/orig-$(basename "$i").dump" -new "dumps/new-$(basename "$i").dump; done It will show smth like
|
If I didn't miss anything, I think we only need to keep ABI compatibility for api. These changes keep API compatibility for sdk and exporters. |
I noticed that the library does not have a SOVERSION and thought that the changes could break the existing consumers (I know that Alpine Linux ships OpenTelemetry C++ libraries). That's why I asked :-) |
If we build otel-cpp with cmake, we can use
Thanks. I noticed #3110 and agree with the SOVERSION idea. Let's continue discussing it there. |
@owent Thanks for the PR. With the use of the How about having two separate recordables:
|
Good point. |
Fixes #3135
Fixes #2651
Changes
MixedAttributeMap
to store bothstd::unordered_map<std::string, opentelemetry::common::AttributeValue>
andAttributeMap
OwnedAttributeValue
,std::vector<nostd::string_view>
andbool
array forReadWriteLogRecord
.For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes