-
Notifications
You must be signed in to change notification settings - Fork 381
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
[PROF-11306] Upgrade libdatadog dependency to 16.0.1 #4353
Conversation
**What does this PR do?** This PR includes the changes documented in the "Releasing a new version to rubygems.org" part of the README: https://github.com/datadog/libdatadog/tree/main/ruby#releasing-a-new-version-to-rubygemsorg **Motivation:** Enable Ruby to use libdatadog v16.0.1. Of particular interest, this includes improvements to crashtracking and the managed string table needed by DataDog/dd-trace-rb#4331 . **Additional Notes:** N/A **How to test the change?** I've tested this release locally using the changes in DataDog/dd-trace-rb#4353 . As a reminder, new libdatadog releases don't get automatically picked up by dd-trace-rb, so the PR that bumps the Ruby profiler will also test this release against all supported Ruby versions.
**What does this PR do?** This PR includes the changes documented in the "Releasing a new version to rubygems.org" part of the README: https://github.com/datadog/libdatadog/tree/main/ruby#releasing-a-new-version-to-rubygemsorg **Motivation:** Enable Ruby to use libdatadog v16.0.1. Of particular interest, this includes improvements to crashtracking and the managed string table needed by DataDog/dd-trace-rb#4331 . **Additional Notes:** N/A **How to test the change?** I've tested this release locally using the changes in DataDog/dd-trace-rb#4353 . As a reminder, new libdatadog releases don't get automatically picked up by dd-trace-rb, so the PR that bumps the Ruby profiler will also test this release against all supported Ruby versions.
Datadog ReportBranch report: ✅ 0 Failed, 22023 Passed, 1477 Skipped, 6m 8.59s Total Time |
**What does this PR do?** This PR updates the crasktracker C code to build with the latest libdatadog changes (in main) that will become part of libdatadog 15. **Motivation:** I'm working on a libdatadog branch and had to do this to unblock my work, so I decided I'll create a PR with it so nobody needs to repeat this work. **Additional Notes:** I'm opening this PR as draft as we shouldn't merge this until libdatadog 15 is out. **How to test the change?** Existing test coverage is enough to validate this.
**What does this PR do?** This PR upgrades the datadog gem to use libdatadog 16.0.1. It includes a few changes to match breaking API updates in crashtracking. **Motivation:** Libdatadog 16 is needed to unblock #4331 . This version also brings a few crashtracking improvements. **Change log entry** Yes. Upgrade libdatadog dependency to 16.0.1 **Additional Notes:** As usual, I'm opening this PR as a draft as libdatadog 16.0.1 is not yet available on rubygems.org, and I'll come back to re-trigger CI and mark this as non-draft once it is. **How to test the change?** Our existing test coverage includes libdatadog testing, so a green C is good here :)
Fixes these bogus warnings (that get turned into errors in our CI): ``` ../../../../ext/datadog_profiling_native_extension/collectors_stack.c: In function ‘sample_thread’: ../../../../ext/datadog_profiling_native_extension/collectors_stack.c:303:7: error: missing initializer for field ‘build_id_id’ of ‘struct ddog_prof_Mapping’ [-Werror=missing-field-initializers] 303 | .mapping = {.filename = DDOG_CHARSLICE_C(""), .build_id = DDOG_CHARSLICE_C("")}, | ^ In file included from /usr/local/bundle/gems/libdatadog-16.0.1.1.0-x86_64-linux/vendor/libdatadog-16.0.1/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/../../include/datadog/profiling.h:13, from ../../../../ext/datadog_profiling_native_extension/libdatadog_helpers.h:3, from ../../../../ext/datadog_profiling_native_extension/collectors_stack.c:5: /usr/local/bundle/gems/libdatadog-16.0.1.1.0-x86_64-linux/vendor/libdatadog-16.0.1/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/../../include/datadog/common.h:520:36: note: ‘build_id_id’ declared here 520 | struct ddog_prof_ManagedStringId build_id_id; | ^~~~~~~~~~~ ../../../../ext/datadog_profiling_native_extension/collectors_stack.c: In function ‘maybe_add_placeholder_frames_omitted’: ../../../../ext/datadog_profiling_native_extension/collectors_stack.c:382:5: error: missing initializer for field ‘build_id_id’ of ‘struct ddog_prof_Mapping’ [-Werror=missing-field-initializers] 382 | .mapping = {.filename = DDOG_CHARSLICE_C(""), .build_id = DDOG_CHARSLICE_C("")}, | ^ In file included from /usr/local/bundle/gems/libdatadog-16.0.1.1.0-x86_64-linux/vendor/libdatadog-16.0.1/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/../../include/datadog/profiling.h:13, from ../../../../ext/datadog_profiling_native_extension/libdatadog_helpers.h:3, from ../../../../ext/datadog_profiling_native_extension/collectors_stack.c:5: /usr/local/bundle/gems/libdatadog-16.0.1.1.0-x86_64-linux/vendor/libdatadog-16.0.1/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/../../include/datadog/common.h:520:36: note: ‘build_id_id’ declared here 520 | struct ddog_prof_ManagedStringId build_id_id; | ^~~~~~~~~~~ ../../../../ext/datadog_profiling_native_extension/collectors_stack.c: In function ‘record_placeholder_stack’: ../../../../ext/datadog_profiling_native_extension/collectors_stack.c:429:5: error: missing initializer for field ‘build_id_id’ of ‘struct ddog_prof_Mapping’ [-Werror=missing-field-initializers] 429 | .mapping = {.filename = DDOG_CHARSLICE_C(""), .build_id = DDOG_CHARSLICE_C("")}, | ^ In file included from /usr/local/bundle/gems/libdatadog-16.0.1.1.0-x86_64-linux/vendor/libdatadog-16.0.1/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/../../include/datadog/profiling.h:13, from ../../../../ext/datadog_profiling_native_extension/libdatadog_helpers.h:3, from ../../../../ext/datadog_profiling_native_extension/collectors_stack.c:5: /usr/local/bundle/gems/libdatadog-16.0.1.1.0-x86_64-linux/vendor/libdatadog-16.0.1/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/../../include/datadog/common.h:520:36: note: ‘build_id_id’ declared here 520 | struct ddog_prof_ManagedStringId build_id_id; | ^~~~~~~~~~~ cc1: all warnings being treated as errors ```
3d3f11e
to
78670f1
Compare
BenchmarksBenchmark execution time: 2025-02-10 11:07:30 Comparing candidate commit 78670f1 in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 30 metrics, 2 unstable metrics. scenario:profiler - sample timeline=false
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4353 +/- ##
==========================================
+ Coverage 97.72% 97.74% +0.01%
==========================================
Files 1347 1347
Lines 82349 82349
Branches 4187 4187
==========================================
+ Hits 80475 80488 +13
+ Misses 1874 1861 -13 ☔ View full report in Codecov by Sentry. |
**What does this PR do?** This PR fixes the crashtracking specs failing on https://github.com/Datadog/vaccine/actions/runs/13239150949 (from DataDog/dd-trace-rb#4353 ) due to the `additional_stacktraces` key no longer being included in the payload. Since I removed the assertion on the key, the updated test will work on both libdatadog < v16 as well as >= v16. **Motivation:** Unblock upgrade to libdatadog v16. **Additional Notes:** To get the "records", I needed to 1. Clone catadog, bundle install 2. mkdir records 3. bundle exec bin/catadog --record records --no-forward ...and then `kill -SEGV` a Ruby process that had dd-trace-rb loaded. This was enough for me: ```bash DD_TRACE_AGENT_PORT=8128 be ruby -e "require 'datadog'; Datadog.configure { }; sleep" ``` **How to test the change?** I've gathered the records from both libdatadog < v16 and v16 in https://gist.github.com/ivoanjo/52314e67602f2039bdcfe4ab869701b2 and used them to validate this change. By placing them into a directory, they can be validated as such: ```bash RECORDS_DIR=records-new/ bundle exec rspec spec/records_spec.rb ```
What does this PR do?
This PR upgrades the datadog gem to use libdatadog 16.0.1.
It includes a few changes to match breaking API updates in crashtracking.
Motivation:
Libdatadog 16 is needed to unblock #4331 .
This version also brings a few crashtracking improvements.
Change log entry
Yes. Upgrade libdatadog dependency to 16.0.1
Additional Notes:
As usual, I'm opening this PR as a draft as libdatadog 16.0.1 is not yet available on rubygems.org, and I'll come back to re-trigger CI and mark this as non-draft once it is.Update: v16.0.1 now up on rubygems.org
How to test the change?
Our existing test coverage includes libdatadog testing, so a green C is good here :)