lib/elastic_apm/config.rb in elastic-apm-3.4.0 vs lib/elastic_apm/config.rb in elastic-apm-3.5.0

- old
+ new

@@ -30,16 +30,15 @@ option :central_config, type: :bool, default: true option :current_user_email_method, type: :string, default: 'email' option :current_user_id_method, type: :string, default: 'id' option :current_user_username_method, type: :string, default: 'username' option :custom_key_filters, type: :list, default: [], converter: RegexpList.new - option :default_tags, type: :dict, default: {} option :default_labels, type: :dict, default: {} option :disable_metrics, type: :list, default: [], converter: WildcardPatternList.new option :disable_send, type: :bool, default: false option :disable_start_message, type: :bool, default: false - option :disabled_instrumentations, type: :list, default: %w[json] + option :disable_instrumentations, type: :list, default: %w[json] option :disabled_spies, type: :list, default: [] option :environment, type: :string, default: ENV['RAILS_ENV'] || ENV['RACK_ENV'] option :framework_name, type: :string option :framework_version, type: :string option :filter_exception_types, type: :list, default: [] @@ -56,10 +55,11 @@ option :proxy_address, type: :string option :proxy_headers, type: :dict option :proxy_password, type: :string option :proxy_port, type: :int option :proxy_username, type: :string + option :sanitize_field_names, type: :list, default: [], converter: WildcardPatternList.new option :server_ca_cert, type: :string option :service_name, type: :string option :service_version, type: :string option :source_lines_error_app_frames, type: :int, default: 5 option :source_lines_error_library_frames, type: :int, default: 0 @@ -67,14 +67,14 @@ option :source_lines_span_library_frames, type: :int, default: 0 option :span_frames_min_duration, type: :float, default: '5ms', converter: Duration.new(default_unit: 'ms') option :stack_trace_limit, type: :int, default: 999_999 option :transaction_max_spans, type: :int, default: 500 option :transaction_sample_rate, type: :float, default: 1.0 + option :use_elastic_traceparent_header, type: :bool, default: true + option :use_experimental_sql_parser, type: :bool, default: false option :verify_server_cert, type: :bool, default: true - option :use_experimental_sql_parser, type: :bool, default: false - # rubocop:enable Metrics/LineLength, Layout/ExtraSpacing def initialize(options = {}) @options = load_schema assign(options) @@ -127,11 +127,11 @@ tilt ] end def enabled_instrumentations - available_instrumentations - disabled_instrumentations + available_instrumentations - disable_instrumentations end def method_missing(name, *args) return super unless DEPRECATED_OPTIONS.include?(name) warn "The option `#{name}' has been removed." @@ -190,9 +190,36 @@ end end def inspect super.split.first + '>' + end + + # Deprecations + + def default_tags=(value) + warn '[DEPRECATED] The option default_tags has been renamed to ' \ + 'default_labels.' + self.default_labels = value + end + + def custom_key_filters=(value) + unless value == self.class.schema[:custom_key_filters][:default] + warn '[DEPRECATED] The option custom_key_filters is being removed. ' \ + 'See sanitize_field_names for an alternative.' + end + + set(:custom_key_filters, value) + end + + def disabled_instrumentations + disable_instrumentations + end + + def disabled_instrumentations=(value) + warn '[DEPRECATED] The option disabled_instrumentations has been ' \ + 'renamed to disable_instrumentations to align with other agents.' + self.disable_instrumentations = value end private def load_config_file