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-8299] Remove legacy profiler codepath #3172

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

ivoanjo
Copy link
Member

@ivoanjo ivoanjo commented Sep 29, 2023

What does this PR do?

For a while, dd-trace-rb has actually been shipping two profilers.

Internally, we've been calling them "Ruby CPU Profiling 2.0" and "legacy profiler".

This PR removes the "legacy profiler", leaving the "Ruby CPU Profiling 2.0" profiler as the only option avaialble.

Motivation:

Back in April, the "Ruby CPU Profiling 2.0" went GA and thus became the default profiler that gets used.

At the time, I decided to keep the "legacy profiler" around just in case of unknown-unknowns: in case there was a big issue with "CPU Profiling 2.0" profiler that would make it not usable to some of our customers.

That was back in April, and here's us at the end of September and we did not see any issues, and adoption of newer versions of the gem (and thus the "CPU Profiling 2.0" profiler) is quite high.

So I'm confident we can remove the "legacy profiler", which is quite a nice cleanup to the codebase.

Additional Notes:

  • The removed files in lib/datadog/core were actually not used by anything else in ddtrace. At some point in the past we thought we may reuse them, but we clearly didn't, so I think it's time to remove them. (These classes were not part of our public API, so they can be removed before 2.0).

  • The protobuf/pprof decoding code was moved to spec/ since the profiling specs still make use of it. The encoding part was deleted.

  • There were a few tiny loose ends that were waiting for the "legacy profiler" to be deleted to be fixed/cleaned up. I've gone ahead and included those as well.

  • The profiler no longer needs the google-protobuf gem (but we used it for the specs). Once this cleanup gets released, I'll do a PR to update https://docs.datadoghq.com/profiler/enabling/ruby/ to reflect this.

How to test the change?

Since the "legacy profiler" was off by default, the only thing to be tested is that the profiler is not affected by these changes.

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

**What does this PR do?**

For a while, dd-trace-rb has actually been shipping two profilers.

Internally, we've been calling them "Ruby CPU Profiling 2.0" and
"legacy profiler".

This PR removes the "legacy profiler", leaving the "Ruby CPU Profiling
2.0" profiler as the only option avaialble.

**Motivation:**

Back in April, the "Ruby CPU Profiling 2.0" went GA and thus became
the default profiler that gets used.

At the time, I decided to keep the "legacy profiler" around just
in case of unknown-unknowns: in case there was a big issue with
"CPU Profiling 2.0" profiler that would make it not usable to some
of our customers.

That was back in April, and here's us at the end of September and we
did not see any issues, and adoption of newer versions of the gem
(and thus the "CPU Profiling 2.0" profiler) is quite high.

So I'm confident we can remove the "legacy profiler", which is
quite a nice cleanup to the codebase.

**Additional Notes:**

* The removed files in `lib/datadog/core` were actually not used
  by anything else in ddtrace. At some point in the past we thought
  we may reuse them, but we clearly didn't, so I think it's time
  to remove them. (These classes were not part of our public API,
  so they can be removed before 2.0).

* The protobuf/pprof decoding code was moved to `spec/` since the
  profiling specs still make use of it. The encoding part was deleted.

* There were a few tiny loose ends that were waiting for the "legacy
  profiler" to be deleted to be fixed/cleaned up. I've gone
  ahead and included those as well.

* The profiler no longer needs the `google-protobuf` gem (but we
  used it for the specs). Once this cleanup gets released, I'll
  do a PR to update https://docs.datadoghq.com/profiler/enabling/ruby/
  to reflect this.

**How to test the change?**

Since the "legacy profiler" was off by default, the only thing to
be tested is that the profiler is not affected by these changes.
@ivoanjo ivoanjo requested review from a team as code owners September 29, 2023 11:40
@github-actions github-actions bot added core Involves Datadog core libraries profiling Involves Datadog profiling labels Sep 29, 2023
Copy link
Member

@GustavoCaso GustavoCaso left a comment

Choose a reason for hiding this comment

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

Amazing cleanup 🔥

@ivoanjo ivoanjo merged commit 116dfd9 into master Sep 29, 2023
176 checks passed
@ivoanjo ivoanjo deleted the ivoanjo/prof-8299-remove-legacy-profiler branch September 29, 2023 12:36
@github-actions github-actions bot added this to the 1.15.0 milestone Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Involves Datadog core libraries profiling Involves Datadog profiling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants