Class: Datadog::Core::Configuration::Settings::DSL::Profiling::Advanced

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/core/configuration/settings.rb

Defined Under Namespace

Classes: Endpoint

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#code_provenance_enabledObject

Disable gathering of names and versions of gems in use by the service, used to power grouping and categorization of stack traces.



239
240
241
# File 'lib/datadog/core/configuration/settings.rb', line 239

def code_provenance_enabled
  @code_provenance_enabled
end

#force_enable_gc_profilingObject

Forces enabling of profiling of time/resources spent in Garbage Collection.

Note that setting this to "false" (or not setting it) will not prevent the feature from being being automatically enabled in the future.

This toggle was added because, although this feature is safe and enabled by default on Ruby 2.x, on Ruby 3.x it can break in applications that make use of Ractors due to two Ruby VM bugs: https://bugs.ruby-lang.org/issues/19112 AND https://bugs.ruby-lang.org/issues/18464.

If you use Ruby 3.x and your application does not use Ractors (or if your Ruby has been patched), the feature is fully safe to enable and this toggle can be used to do so.

Furthermore, currently this feature can add a lot of overhead for GC-heavy workloads.

We expect the once the above issues are overcome, we'll automatically enable the feature on fixed Ruby versions.



280
281
282
# File 'lib/datadog/core/configuration/settings.rb', line 280

def force_enable_gc_profiling
  @force_enable_gc_profiling
end

#force_enable_new_profilerObject

Forces enabling the new profiler. We do not yet recommend turning on this option.

Note that setting this to "false" (or not setting it) will not prevent the new profiler from being automatically used in the future. This option will be deprecated for removal once the new profiler gets enabled by default for all customers.



259
260
261
# File 'lib/datadog/core/configuration/settings.rb', line 259

def force_enable_new_profiler
  @force_enable_new_profiler
end

#legacy_transport_enabledObject

No longer does anything, and will be removed on dd-trace-rb 2.0.

This was added as a temporary support option in case of issues with the new Profiling::HttpTransport class but we're now confident it's working nicely so we've removed the old code path.



245
246
247
# File 'lib/datadog/core/configuration/settings.rb', line 245

def legacy_transport_enabled
  @legacy_transport_enabled
end

#max_eventsObject

This should never be reduced, as it can cause the resulting profiles to become biased. The current default should be enough for most services, allowing 16 threads to be sampled around 30 times per second for a 60 second period.



213
214
215
# File 'lib/datadog/core/configuration/settings.rb', line 213

def max_events
  @max_events
end

#max_framesObject

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.



217
218
219
# File 'lib/datadog/core/configuration/settings.rb', line 217

def max_frames
  @max_frames
end

Instance Method Details

#endpointDatadog::Core::Configuration::Settings::DSL::Profiling::Advanced::Endpoint

Returns a configuration object.



223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/datadog/core/configuration/settings.rb', line 223

settings :endpoint do
  settings :collection do
    # When using profiling together with tracing, this controls if endpoint names
    # are gathered and reported together with profiles.
    #
    # @default `DD_PROFILING_ENDPOINT_COLLECTION_ENABLED` environment variable, otherwise `true`
    # @return [Boolean]
    option :enabled do |o|
      o.default { env_to_bool(Profiling::Ext::ENV_ENDPOINT_COLLECTION_ENABLED, true) }
      o.lazy
    end
  end
end