lib/ddtrace/configuration/settings.rb in ddtrace-0.47.0 vs lib/ddtrace/configuration/settings.rb in ddtrace-0.48.0

- old
+ new

@@ -1,10 +1,11 @@ require 'logger' require 'ddtrace/configuration/base' require 'ddtrace/ext/analytics' require 'ddtrace/ext/distributed' +require 'ddtrace/ext/profiling' require 'ddtrace/ext/runtime' require 'ddtrace/ext/sampling' module Datadog module Configuration @@ -104,9 +105,39 @@ option :level, default: ::Logger::INFO end def logger=(logger) get_option(:logger).instance = logger + end + + settings :profiling do + option :enabled do |o| + o.default { env_to_bool(Ext::Profiling::ENV_ENABLED, false) } + o.lazy + end + + settings :exporter do + option :instances + option :transport + option :transport_options, default: ->(_o) { {} }, lazy: true + end + + option :max_events, default: 32768 + + # Controls the maximum number of frames for each thread sampled. Can be tuned to avoid omitted frames in the + # produced profiles. Increasing this may increase the overhead of profiling. + option :max_frames do |o| + o.default { env_to_int(Ext::Profiling::ENV_MAX_FRAMES, 400) } + o.lazy + end + + settings :upload do + option :timeout do |o| + o.setter { |value| value.nil? ? 30.0 : value.to_f } + o.default { env_to_float(Ext::Profiling::ENV_UPLOAD_TIMEOUT, 30.0) } + o.lazy + end + end end option :report_hostname do |o| o.default { env_to_bool(Ext::NET::ENV_REPORT_HOSTNAME, false) } o.lazy