Skip to content

Commit

Permalink
Minor: Tweak profiling error guidance when pkg-config is missing
Browse files Browse the repository at this point in the history
**What does this PR do?**:

This PR adds the following tip to the error message that customers
see when trying to enable profiling but the `pkg-config` system tool
is missing:

> (Tip: When fixing this, ensure `pkg-config` is installed **before**
> running `bundle install`, and remember to clear any installed gems
> cache).

We've had a couple of customers so far run into this issue -- they
install `pkg-config`, and can see it running on their container, but
they still see the error, because when `bundle install` runs,
the tool is not there yet.

Hopefully this tip will avoid other customers running into this
issue.

**Motivation**:

Improve customer UX when enabling the profiler.

**Additional Notes**:

I've been considering reimplementing what we need out of `pkg-config`
so that we stop requiring this tool but for now hopefully this
reduces the number of frustrated customers due to this problem.

**How to test the change?**:

The easiest way to test this is to use one of our development
Ruby images, and just delete `pkg-config` from it using
``rm `which pkg-config` ``.

If then you run `bundle exec rake clean compile` and then try
to run the profiler, you should see the error popping up as a log:

```
$ DD_PROFILING_ENABLED=true bundle exec ddtracerb exec ruby -e "sleep"
W, [2023-02-24T10:33:59.671680 #772]  WARN -- ddtrace: [ddtrace]
Profiling was requested but is not supported, profiling disabled:
Your ddtrace installation is missing support for the Continuous
Profiler because the `pkg-config` system tool is missing. This issue
can usually be fixed by installing one of the following: the
`pkg-config` package on Homebrew and Debian/Ubuntu-based Linux; the
`pkgconf` package on Arch and Alpine-based Linux; the
`pkgconf-pkg-config` package on Fedora/Red Hat-based Linux. (Tip:
When fixing this, ensure `pkg-config` is installed **before**
running `bundle install`, and remember to clear any installed gem
caches). For help solving this issue, please contact Datadog support
at <https://docs.datadoghq.com/help/>. You can also check out the
Continuous Profiler troubleshooting page at
<https://dtdg.co/ruby-profiler-troubleshooting>.
```
  • Loading branch information
ivoanjo committed Feb 24, 2023
1 parent 484d0c1 commit efdf234
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ def self.pkg_config_missing?(command: $PKGCONFIG) # rubocop:disable Style/Global
'the `pkg-config` package on Homebrew and Debian/Ubuntu-based Linux;',
'the `pkgconf` package on Arch and Alpine-based Linux;',
'the `pkgconf-pkg-config` package on Fedora/Red Hat-based Linux.',
'(Tip: When fixing this, ensure `pkg-config` is installed **before**',
'running `bundle install`, and remember to clear any installed gems cache).',
suggested: CONTACT_SUPPORT,
)

Expand Down

0 comments on commit efdf234

Please sign in to comment.