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-5774] Remove support for profiling Ruby 2.1 #2140

Merged
merged 9 commits into from
Jul 12, 2022

Conversation

ivoanjo
Copy link
Member

@ivoanjo ivoanjo commented Jul 8, 2022

What does this PR do?

This PR removes support for profiling Ruby 2.1 using the Continuous Profiling product. Other products shipped in ddtrace (tracing, application security monitoring, CI, etc) are unaffected.

This dropping of support does not impact our customer's ability to install the latest dd-trace-rb on Ruby 2.1. What it does is

  1. Skip compilation of the profiling native extension on Ruby 2.1
  2. Print a warning message when customers try to enable profiling on Ruby 2.1 (but does not otherwise block or break their application)

The warning message shown to customers is:

W, [2022-07-08T14:08:51.295193 #51899] WARN -- ddtrace: [ddtrace] Profiling was requested but is not supported, profiling disabled: Your ddtrace installation is missing support for the Continuous Profiler because
your Ruby version (2.1) is too old to be supported the profiler only supports Ruby 2.2 or newer.
Upgrade to a modern Ruby to enable profiling for your app.

Motivation

There is little customer interest on profiling Ruby 2.1, and supporting old Rubies also comes with an extra tax, especially as we build towards the new native profiler.

Additional Notes

I'm opening this PR as a draft not because it's missing anything, but because it MUST only be merged after dd-trace-rb 1.2.0 is released.

How to test the change?

  • Run test suite on Ruby 2.1
  • Try enabling profiling on a Ruby 2.1 application

@ivoanjo ivoanjo requested a review from a team July 8, 2022 14:07
@ivoanjo ivoanjo marked this pull request as draft July 8, 2022 14:07
@@ -242,6 +247,15 @@ def self.pkg_config_missing?(command: $PKGCONFIG) # rubocop:disable Style/Global
architecture_not_supported unless RUBY_PLATFORM.start_with?('x86_64', 'aarch64')
end

private_class_method def self.on_ruby_2_1?
ruby_version_not_supported = explain_issue(
'your Ruby version (2.1) is too old to be supported.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the message is a bit negative, specially for clients that are not happy to be stuck on 2.1 themselves.

How about something like "the profiler only supports Ruby 2.2 or newer".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable, changed in 91eb862 .

@@ -148,6 +149,10 @@ def self.pkg_config_missing?(command: $PKGCONFIG) # rubocop:disable Style/Global
"Get in touch with us if you're interested in profiling your app!"
].freeze

UPGRADE_RUBY = [
'Upgrade to a modern Ruby to enable profiling for your app.'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "Upgrade to Ruby 2.2 or newer" is more accurate than modern Ruby.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, I think that may be a bit redundant? We always present the two parts of the error message together, e.g. at installation (which is hidden by default by rubygems):

+------------------------------------------------------------------------------+
| Could not compile the Datadog Continuous Profiler because                    |
| the profiler only supports Ruby 2.2 or newer.                                |
|                                                                              |
| The Datadog Continuous Profiler will not be available,                       |
| but all other ddtrace features will work fine!                               |
|                                                                              |
| Upgrade to a modern Ruby to enable profiling for your app.                   |
+------------------------------------------------------------------------------+

and at run-time:

W, [2022-07-11T09:09:22.971998 #20866]  WARN -- ddtrace: [ddtrace] Profiling was requested but is not supported, profiling disabled: Your ddtrace installation is missing support for the Continuous Profiler because the profiler only supports Ruby 2.2 or newer. Upgrade to a modern Ruby to enable profiling for your app

So do you think now that I've changed the first part to already state customers need 2.2+, is it worth repeating it again on the second part?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads fine now! 👍

@ivoanjo ivoanjo marked this pull request as ready for review July 11, 2022 15:08
@ivoanjo
Copy link
Member Author

ivoanjo commented Jul 11, 2022

Update: dd-trace-rb 1.2.0 is out, so this is ready for review. I've noticed there's a conflict because of #2061; I'll push a rebase ASAP to clear it up.

This is the first piece of dropping profiling support for Ruby 2.1.

Instead of the extension building, customers will get the following
message:

```
+------------------------------------------------------------------------------+
| Could not compile the Datadog Continuous Profiler because                    |
| your Ruby version (2.1) is too old to be supported.                          |
|                                                                              |
| The Datadog Continuous Profiler will not be available,                       |
| but all other ddtrace features will work fine!                               |
|                                                                              |
| Upgrade to a modern Ruby to enable profiling for your app.                   |
+------------------------------------------------------------------------------+
```

(Note that, as the message says, other dd-trace-rb features are
untouched and will still work).
…ative extension

Less weird exceptions to maintain, yay!
Message is now going to be

> Could not compile the Datadog Continuous Profiler because
> the profiler only supports Ruby 2.2 or newer.

at installation time, and

> Your ddtrace installation is missing support for the Continuous
> Profiler because the profiler only supports Ruby 2.2 or newer.
@ivoanjo ivoanjo force-pushed the ivoanjo/prof-5773-drop-support-profiling-ruby-2-1 branch from 91eb862 to cf2330a Compare July 12, 2022 11:04
@ivoanjo
Copy link
Member Author

ivoanjo commented Jul 12, 2022

Update: Thanks Tony and Marco. I've rebased to solve the conflicts (related to libddprof -> libdatatadog renaming). Going to press the magic button!

@ivoanjo ivoanjo merged commit 1835642 into master Jul 12, 2022
@ivoanjo ivoanjo deleted the ivoanjo/prof-5773-drop-support-profiling-ruby-2-1 branch July 12, 2022 11:17
@github-actions github-actions bot added this to the 1.3.0 milestone Jul 12, 2022
ivoanjo added a commit to DataDog/documentation that referenced this pull request Dec 13, 2022
We've dropped support for Ruby 2.1 some time ago
(<DataDog/dd-trace-rb#2140>) and I spotted that
the documentation was outdated.
ivoanjo added a commit that referenced this pull request Feb 1, 2023
**What does this PR do?**:

This PR removes support for profiling Ruby 2.2 using the Continuous
Profiling product. Other products shipped in ddtrace (tracing,
application security monitoring, CI, etc) are unaffected.

This dropping of support does not impact our customer's ability to
install the latest dd-trace-rb on Ruby 2.2. What it does is

1. Skip compilation of the profiling native extension on Ruby 2.2
2. Print a warning message when customers try to enable profiling on
   Ruby 2.2 (but does not otherwise block or break their application)

The warning message shown to customers is:

> W, [2023-02-01T11:42:57.022293 #410738]  WARN -- ddtrace: [ddtrace]
> Profiling was requested but is not supported, profiling disabled:
> Your ddtrace installation is missing support for the Continuous
> Profiler because the profiler only supports Ruby 2.3 or newer.
> Upgrade to a modern Ruby to enable profiling for your app.

Customers are welcome to continue using older versions of dd-trace-rb
to profile their Ruby 2.2 (as well as 2.1) applications.

(This PR is similar to #2140 where we dropped support for Ruby 2.1)

**Motivation**:

There is little customer interest on profiling Ruby 2.2, and
supporting old Rubies also comes with an extra tax -- just look
how much code and complexity is being removed by this PR.

**Additional Notes**:

(N/A)

**How to test the change?**:

* Validate that test suite still runs successfully on Ruby 2.2
* Validate that you get the above error message when trying to
  profile a Ruby 2.2 application
ivoanjo added a commit that referenced this pull request Feb 1, 2023
**What does this PR do?**:

This PR removes support for profiling Ruby 2.2 using the Continuous
Profiling product. Other products shipped in ddtrace (tracing,
application security monitoring, CI, etc) are unaffected.

This dropping of support does not impact our customer's ability to
install the latest dd-trace-rb on Ruby 2.2. What it does is

1. Skip compilation of the profiling native extension on Ruby 2.2
2. Print a warning message when customers try to enable profiling on
   Ruby 2.2 (but does not otherwise block or break their application)

The warning message shown to customers is:

> W, [2023-02-01T11:42:57.022293 #410738]  WARN -- ddtrace: [ddtrace]
> Profiling was requested but is not supported, profiling disabled:
> Your ddtrace installation is missing support for the Continuous
> Profiler because the profiler only supports Ruby 2.3 or newer.
> Upgrade to a modern Ruby to enable profiling for your app.

Customers are welcome to continue using older versions of dd-trace-rb
to profile their Ruby 2.2 (as well as 2.1) applications.

(This PR is similar to #2140 where we dropped support for Ruby 2.1)

**Motivation**:

There is little customer interest on profiling Ruby 2.2, and
supporting old Rubies also comes with an extra tax -- just look
how much code and complexity is being removed by this PR.

**Additional Notes**:

(N/A)

**How to test the change?**:

* Validate that test suite still runs successfully on Ruby 2.2
* Validate that you get the above error message when trying to
  profile a Ruby 2.2 application
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.

None yet

3 participants