Skip to content
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-10208] Upgrade to libdatadog 11 #3799

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[PROF-10208] Upgrade to libdatadog 11
**What does this PR do?**

This PR upgrades the datadog gem to use libdatadog 11.

There were some minor tweaks needed in the crashtracker APIs, but
otherwise it's a drop-in upgrade.

**Motivation:**

Staying on the latest libdatadog enables us to pick up the
latest improvements and also makes it easier to develop new features
that need libdatadog changes.

**Additional Notes:**

As usual, I'm opening this PR as a draft as libdatadog 11 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 CI
is good here :)
  • Loading branch information
ivoanjo committed Jul 22, 2024
commit 7bcdf97c17cd7d051c8e009f33f1d012a54a3b12
2 changes: 1 addition & 1 deletion datadog.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Gem::Specification.new do |spec|
# Used by profiling (and possibly others in the future)
# When updating the version here, please also update the version in `native_extension_helpers.rb`
# (and yes we have a test for it)
spec.add_dependency 'libdatadog', '~> 10.0.0.1.0'
spec.add_dependency 'libdatadog', '~> 11.0.0.1.0'

spec.extensions = ['ext/datadog_profiling_native_extension/extconf.rb', 'ext/datadog_profiling_loader/extconf.rb']
end
5 changes: 4 additions & 1 deletion ext/datadog_profiling_native_extension/crashtracker.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ static VALUE _native_start_or_update_on_fork(int argc, VALUE *argv, DDTRACE_UNUS
.endpoint = endpoint,
.resolve_frames = DDOG_PROF_STACKTRACE_COLLECTION_ENABLED_WITH_SYMBOLS_IN_RECEIVER,
.timeout_secs = FIX2INT(upload_timeout_seconds),
// Waits for crash tracker to finish reporting the issue before letting the Ruby process die; see
// https://github.com/DataDog/libdatadog/pull/477 for details
.wait_for_receiver = true,
};

ddog_prof_CrashtrackerMetadata metadata = {
Expand All @@ -83,7 +86,7 @@ static VALUE _native_start_or_update_on_fork(int argc, VALUE *argv, DDTRACE_UNUS

ddog_prof_CrashtrackerResult result =
action == start_action ?
ddog_prof_Crashtracker_init(config, receiver_config, metadata) :
ddog_prof_Crashtracker_init_with_receiver(config, receiver_config, metadata) :
ddog_prof_Crashtracker_update_on_fork(config, receiver_config, metadata);

// Clean up before potentially raising any exceptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module NativeExtensionHelpers
# The MJIT header was introduced on 2.6 and removed on 3.3; for other Rubies we rely on debase-ruby_core_source
CAN_USE_MJIT_HEADER = RUBY_VERSION.start_with?('2.6', '2.7', '3.0.', '3.1.', '3.2.')

LIBDATADOG_VERSION = '~> 10.0.0.1.0'
LIBDATADOG_VERSION = '~> 11.0.0.1.0'

def self.fail_install_if_missing_extension?
ENV[ENV_FAIL_INSTALL_IF_MISSING_EXTENSION].to_s.strip.downcase == 'true'
Expand Down