Module: Datadog::ErrorTracking::Configuration::Settings Private

Defined in:
lib/datadog/error_tracking/configuration/settings.rb

Overview

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

Settings

Class Method Summary collapse

Class Method Details

.add_settings!(base) ⇒ 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.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/datadog/error_tracking/configuration/settings.rb', line 15

def self.add_settings!(base)
  base.class_eval do
    # Error Tracking specific configurations.
    # @public_api
    settings :error_tracking do
      # Enable automatic reporting of handled errors and defines the scope
      # for which to report errors: user code, gems, or both. Possible
      # values are: all | user | third_party.
      #
      # @default 'DD_ERROR_TRACKING_HANDLED_ERRORS' environment variable, otherwise `nil`
      # @return [String, nil]
      option :handled_errors do |o|
        o.type :string, nilable: true
        o.default Ext::DEFAULT_HANDLED_ERRORS
        o.env Ext::ENV_HANDLED_ERRORS
        o.setter do |value|
          next value if Ext::VALID_HANDLED_ERRORS.include?(value)

          unless value.nil?
            Datadog.logger.warn(
              "Invalid handled errors scope: #{value}. " \
              "Supported values are: #{Ext::VALID_HANDLED_ERRORS.join(" | ")}. " \
              'Deactivating the feature.'
            )
          end

          Ext::DEFAULT_HANDLED_ERRORS
        end
      end

      # Enable automatic reporting of handled errors and specify what files should be
      # instrumented. The value is a list of comma separated paths, filenames or gem names.
      # The paths can be absolute, starting with '/' or relative to directory in which the program
      # is launched, starting with './'.
      #
      # @default 'DD_ERROR_TRACKING_HANDLED_ERRORS_MODULES' environment variable, otherwise `nil`
      # @return [String, nil]
      option :handled_errors_include do |o|
        o.type :array
        o.default []
        o.env Ext::ENV_HANDLED_ERRORS_INCLUDE
      end
    end
  end
end

.extended(base) ⇒ 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.



10
11
12
13
# File 'lib/datadog/error_tracking/configuration/settings.rb', line 10

def self.extended(base)
  base = base.singleton_class unless base.is_a?(Class)
  add_settings!(base)
end