Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix NoMethodError when running
Datadog.configure
after only requiri…
…ng core The fix in #1998, specifically in 2e5d1ee broke using `datadog/core` directly without `require 'ddtrace'`. For instance: ``` bundle exec ruby -e "require 'datadog/core'; Datadog.configure { }" Traceback (most recent call last): 9: from -e:1:in `<main>' 8: from .../lib/datadog/core/configuration.rb:89:in `configure' 7: from .../lib/datadog/core/configuration.rb:223:in `safely_synchronize' 6: from .../lib/datadog/core/configuration.rb:223:in `synchronize' 5: from .../lib/datadog/core/configuration.rb:225:in `block in safely_synchronize' 4: from .../lib/datadog/core/configuration.rb:94:in `block in configure' 3: from .../lib/datadog/core/configuration.rb:243:in `build_components' 2: from .../lib/datadog/core/configuration.rb:243:in `new' 1: from .../lib/datadog/core/configuration/components.rb:345:in `initialize' .../lib/datadog/core/configuration/components.rb:202:in `build_profiler': undefined method `supported?' for Datadog::Profiling:Module (NoMethodError) ``` As a workaround, I've added a `require 'datadog/profiling'` in `build_profiler`: this avoids re-adding the circular dependency issue, but fixes this use-case. Additionally, I've made is such that profiling is only loaded if it is enabled, which means that customers not using it will not need to load it, which is a nice bonus vs what we did prior to #1998.
- Loading branch information