Class: Datadog::DI::CaptureLimits Private

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/di/capture_limits.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_reference_depth: nil, max_collection_size: nil, max_length: nil, max_field_count: nil) ⇒ CaptureLimits

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CaptureLimits.



6
7
8
9
10
11
12
# File 'lib/datadog/di/capture_limits.rb', line 6

def initialize(max_reference_depth: nil, max_collection_size: nil,
  max_length: nil, max_field_count: nil)
  @max_reference_depth = max_reference_depth
  @max_collection_size = max_collection_size
  @max_length = max_length
  @max_field_count = max_field_count
end

Instance Attribute Details

#max_collection_sizeObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
# File 'lib/datadog/di/capture_limits.rb', line 16

def max_collection_size
  @max_collection_size
end

#max_field_countObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
# File 'lib/datadog/di/capture_limits.rb', line 20

def max_field_count
  @max_field_count
end

#max_lengthObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



18
19
20
# File 'lib/datadog/di/capture_limits.rb', line 18

def max_length
  @max_length
end

#max_reference_depthObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
# File 'lib/datadog/di/capture_limits.rb', line 14

def max_reference_depth
  @max_reference_depth
end

Class Method Details

.resolve(expr_limits:, probe:, settings:) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/datadog/di/capture_limits.rb', line 22

def self.resolve(expr_limits:, probe:, settings:)
  di = settings.dynamic_instrumentation
  {
    depth: expr_limits&.max_reference_depth ||
      probe.max_capture_depth ||
      di.max_capture_depth,
    collection_size: expr_limits&.max_collection_size ||
      probe.max_capture_collection_size ||
      di.max_capture_collection_size,
    length: expr_limits&.max_length ||
      probe.max_capture_string_length ||
      di.max_capture_string_length,
    attribute_count: expr_limits&.max_field_count ||
      probe.max_capture_attribute_count ||
      di.max_capture_attribute_count,
  }
end