Module: Datadog::Contrib::Extensions::Configuration
- Defined in:
- lib/ddtrace/contrib/extensions.rb
Overview
Configuration methods for Datadog module.
Defined Under Namespace
Modules: Settings
Instance Method Summary collapse
Instance Method Details
#configure(target = configuration, opts = {}) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/ddtrace/contrib/extensions.rb', line 38 def configure(target = configuration, opts = {}) # Reconfigure core settings super # Activate integrations if target.respond_to?(:integrations_pending_activation) reduce_verbosity = target.respond_to?(:reduce_verbosity?) ? target.reduce_verbosity? : false target.integrations_pending_activation.each do |integration| next unless integration.respond_to?(:patch) # integration.patch returns either true or a hash of details on why patching failed patch_results = integration.patch next if patch_results == true # if patching failed, only log output if verbosity is unset # or if patching failure is due to compatibility or integration specific reasons next unless !reduce_verbosity || ((patch_results[:available] && patch_results[:loaded]) && (!patch_results[:compatible] || !patch_results[:patchable])) desc = "Available?: #{patch_results[:available]}" desc += ", Loaded? #{patch_results[:loaded]}" desc += ", Compatible? #{patch_results[:compatible]}" desc += ", Patchable? #{patch_results[:patchable]}" Datadog.logger.warn("Unable to patch #{patch_results[:name]} (#{desc})") end target.integrations_pending_activation.clear end target end |