Minor: Improve error message when ddtrace_profiling_loader fails to load #2957
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?:
This PR tweaks the error message for when
ddtrace_profiling_loader
fails to load to suggest to customers that they reinstall ddtrace.This came out of a customer running into this issue in #2242 (comment)
Here's how it looks now when it fails:
Motivation:
Suggest the most common fix for this issue instead of leaving customers to wonder about the next steps.
Additional Notes:
Since the
ddtrace_profiling_loader
is very very simple, it should always be available and be found. When it's not found, on all cases I've seen it's because it hardcodes the current Ruby version it its name, and thus it needs to be rebuilt after upgrading Ruby.Thus it makes sense to suggest rebuilding it.
(The loader doesn't strictly need to include the Ruby version, but doing so makes it easier to switch Rubies during development, and it acts as a canary for the profiling native extension as well -- if this one fails to load, the native extension will also for the same reason).
How to test the change?:
This issue can be triggered with the example command-line above by not compiling profiler (or running
bundle exec rake clean
) and then removing any pre-existing profiling extensions(
rm lib/ddtrace_profiling_*
).