diff --git a/lib/new_relic/agent/agent_helpers/connect.rb b/lib/new_relic/agent/agent_helpers/connect.rb index c74b110a9a..e4380e0de9 100644 --- a/lib/new_relic/agent/agent_helpers/connect.rb +++ b/lib/new_relic/agent/agent_helpers/connect.rb @@ -162,7 +162,7 @@ def wait_on_connect(timeout) def connect_options(options) { - keep_retrying: Agent.config[:keep_retrying], + keep_retrying: true, force_reconnect: Agent.config[:force_reconnect] }.merge(options) end diff --git a/lib/new_relic/agent/attribute_filter.rb b/lib/new_relic/agent/attribute_filter.rb index 0008b965c8..4a5dcc42d9 100644 --- a/lib/new_relic/agent/attribute_filter.rb +++ b/lib/new_relic/agent/attribute_filter.rb @@ -124,8 +124,6 @@ def prep_attributes_exclude_rules(config) def prep_capture_params_rules(config) build_rule(['request.parameters.*'], include_destinations_for_capture_params(config[:capture_params]), true) - build_rule(['job.resque.args.*'], include_destinations_for_capture_params(config[:'resque.capture_params']), true) - build_rule(['job.sidekiq.args.*'], include_destinations_for_capture_params(config[:'sidekiq.capture_params']), true) end def prep_datastore_rules(config) diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index 7eaaac4bbd..2775a0d74b 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -176,13 +176,6 @@ def self.thread_profiler_enabled proc { NewRelic::Agent::Threading::BacktraceService.is_supported? } end - # This check supports the js_errors_beta key we've asked clients to - # set. Once JS errors are GA, browser_monitoring.loader can stop - # being dynamic. - def self.browser_monitoring_loader - proc { NewRelic::Agent.config[:js_errors_beta] ? "full" : "rum" } - end - def self.transaction_tracer_transaction_threshold proc { NewRelic::Agent.config[:apdex_t] * 4 } end @@ -370,12 +363,12 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) - a.third.event DESCRIPTION }, + # this is only set via server side config :apdex_t => { :default => 0.5, - :public => true, + :public => false, :type => Float, :allowed_from_server => true, - :deprecated => true, :description => 'For agent versions 3.5.0 or higher, [set your Apdex T via the New Relic UI](/docs/apm/new-relic-apm/apdex/changing-your-apdex-settings).' }, :api_key => { @@ -566,14 +559,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Defines the maximum number of seconds the agent should spend attempting to connect to the collector.' }, # Transaction tracer - :'transaction_tracer.capture_attributes' => { - :default => true, - :public => true, - :type => Boolean, - :deprecated => true, - :allowed_from_server => false, - :description => 'Use [`transaction_tracer.attributes.enabled`](#transaction_tracer-attributes-enabled) instead.' - }, :'transaction_tracer.enabled' => { :default => true, :public => true, @@ -639,16 +624,8 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Specify a threshold in seconds. Transactions with a duration longer than this threshold are eligible for transaction traces. Specify a float value or the string `apdex_f`.' }, # Error collector - :'error_collector.capture_attributes' => { - :default => true, - :public => true, - :type => Boolean, - :deprecated => true, - :allowed_from_server => false, - :description => 'Use [`error_collector.attributes.enabled`](#error_collector-attributes-enabled) instead.' - }, :'error_collector.ignore_classes' => { - :default => [], + :default => ['ActionController::RoutingError', 'Sinatra::NotFound'], :public => true, :type => Array, :allowed_from_server => true, @@ -713,21 +690,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :dynamic_name => true, :description => 'A comma separated list of status codes, possibly including ranges. Errors associated with these status codes, where applicable, will be treated as expected.' }, - :'error_collector.ignore_errors' => { - :default => 'ActionController::RoutingError,Sinatra::NotFound', - :public => true, - :type => String, - :deprecated => true, - :allowed_from_server => true, - :dynamic_name => true, - :description => <<~DESCRIPTION - Use `error_collector.ignore_classes` instead. Specify a comma-delimited list of error classes that the agent should ignore. - - Server side configuration takes precedence for this setting over all environment configurations. This differs from all other configuration settings where environment variable take precedence over server side configuration. - - DESCRIPTION - }, :'error_collector.ignore_messages' => { :default => {}, :public => true, @@ -773,51 +736,16 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :allowed_from_server => true, :description => 'If `true`, enables [auto-injection](/docs/browser/new-relic-browser/installation-configuration/adding-apps-new-relic-browser#select-apm-app) of the JavaScript header for page load timing (sometimes referred to as real user monitoring or RUM).' }, - :'browser_monitoring.capture_attributes' => { - :default => false, - :public => true, - :type => Boolean, - :deprecated => true, - :allowed_from_server => false, - :description => 'Use [`browser_monitoring.attributes.enabled`](#browser_monitoring-attributes-enabled) instead.' - }, - # Analytics events - :'analytics_events.capture_attributes' => { - :default => true, - :public => true, - :type => Boolean, - :deprecated => true, - :allowed_from_server => false, - :description => 'Use [`transaction_events.attributes.enabled`](#transaction_events-attributes-enabled) instead.' - }, - :'analytics_events.enabled' => { - :default => true, - :public => true, - :type => Boolean, - :deprecated => true, - :allowed_from_server => true, - :description => deprecated_description(:'transaction_events.enabled', 'If `true`, enables analytics event sampling.') - }, - :'analytics_events.max_samples_stored' => { - :default => 1200, - :public => true, - :type => Integer, - :deprecated => true, - :allowed_from_server => true, - :description => deprecated_description(:'transaction_events.max_samples_stored', 'Defines the maximum number of request events reported from a single harvest.') - }, # Transaction events :'transaction_events.enabled' => { - :default => value_of(:'analytics_events.enabled'), - :documentation_default => true, + :default => true, :public => true, :type => Boolean, :allowed_from_server => true, :description => 'If `true`, enables transaction event sampling.' }, :'transaction_events.max_samples_stored' => { - :default => value_of(:'analytics_events.max_samples_stored'), - :documentation_default => 1200, + :default => 1200, :public => true, :type => Integer, :allowed_from_server => true, @@ -885,8 +813,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Prefix of attributes to include in all destinations. Allows `*` as wildcard at end.' }, :'browser_monitoring.attributes.enabled' => { - :default => value_of(:'browser_monitoring.capture_attributes'), - :documentation_default => false, + :default => false, :public => true, :type => Boolean, :allowed_from_server => false, @@ -909,8 +836,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Prefix of attributes to include in browser monitoring. Allows `*` as wildcard at end.' }, :'error_collector.attributes.enabled' => { - :default => value_of(:'error_collector.capture_attributes'), - :documentation_default => true, + :default => true, :public => true, :type => Boolean, :allowed_from_server => false, @@ -956,8 +882,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Prefix of attributes to include on span events. Allows `*` as wildcard at end.' }, :'transaction_events.attributes.enabled' => { - :default => value_of(:'analytics_events.capture_attributes'), - :documentation_default => true, + :default => true, :public => true, :type => Boolean, :allowed_from_server => false, @@ -1003,8 +928,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Prefix of attributes to include on transaction segments. Allows `*` as wildcard at end.' }, :'transaction_tracer.attributes.enabled' => { - :default => value_of(:'transaction_tracer.capture_attributes'), - :documentation_default => true, + :default => true, :public => true, :type => Boolean, :allowed_from_server => false, @@ -1213,15 +1137,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :allowed_from_server => false, :description => 'If `true`, disables instrumentation for Active Record 4+' }, - :disable_bunny => { - :default => false, - :public => true, - :type => Boolean, - :deprecated => true, - :dynamic_name => true, - :allowed_from_server => false, - :description => deprecated_description(:'instrumentation.bunny', 'If `true`, disables instrumentation for the bunny gem.') - }, :disable_cpu_sampler => { :default => false, :public => true, @@ -1230,41 +1145,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :allowed_from_server => false, :description => 'If `true`, the agent won\'t sample the CPU usage of the host process.' }, - :disable_curb => { - :default => false, - :public => true, - :type => Boolean, - :deprecated => true, - :dynamic_name => true, - :allowed_from_server => false, - :description => deprecated_description(:'instrumentation.curb', 'If `true`, disables instrumentation for the curb gem.') - }, - :disable_database_instrumentation => { - :default => false, - :public => true, - :type => Boolean, - :allowed_from_server => false, - :deprecated => true, - :description => 'Use [`disable_sequel_instrumentation`](#disable_sequel_instrumentation) instead.' - }, - :disable_dalli => { - :default => value_of(:disable_memcache_instrumentation), - :documentation_default => false, - :public => true, - :type => Boolean, - :deprecated => true, - :allowed_from_server => false, - :description => deprecated_description(:'instrumentation.memcache', 'If `true`, disables instrumentation for the dalli gem.') - }, - :disable_dalli_cas_client => { - :default => value_of(:disable_memcache_instrumentation), - :documentation_default => false, - :public => true, - :type => Boolean, - :deprecated => true, - :allowed_from_server => false, - :description => deprecated_description(:'instrumentation.memcache', "If `true`, disables instrumentation for the dalli gem's additional CAS client support.") - }, :disable_delayed_job_sampler => { :default => false, :public => true, @@ -1273,49 +1153,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :allowed_from_server => false, :description => 'If `true`, the agent won\'t measure the depth of Delayed Job queues.' }, - :disable_dj => { - :default => false, - :public => true, - :deprecated => true, - :type => Boolean, - :allowed_from_server => false, - :description => deprecated_description(:'instrumentation.delayed_job', 'If `true`, disables [Delayed::Job instrumentation](/docs/agents/ruby-agent/background-jobs/delayedjob).') - }, - :disable_excon => { - :default => false, - :public => true, - :type => Boolean, - :dynamic_name => true, - :deprecated => true, - :allowed_from_server => false, - :description => deprecated_description(:'instrumentation.excon', 'If `true`, disables instrumentation for the excon gem.') - }, - :disable_memcached => { - :default => value_of(:disable_memcache_instrumentation), - :documentation_default => false, - :public => true, - :type => Boolean, - :deprecated => true, - :allowed_from_server => false, - :description => deprecated_description(:'instrumentation.memcached', 'If `true`, disables instrumentation for the memcached gem.') - }, - :disable_memcache_client => { - :default => value_of(:disable_memcache_instrumentation), - :documentation_default => false, - :public => true, - :type => Boolean, - :deprecated => true, - :allowed_from_server => false, - :description => deprecated_description(:'instrumentation.memcache-client', 'If `true`, disables instrumentation for the memcache-client gem.') - }, - :disable_memcache_instrumentation => { - :default => false, - :public => true, - :type => Boolean, - :deprecated => true, - :allowed_from_server => false, - :description => deprecated_description(:'instrumentation.memcache', 'If `true`, disables memcache instrumentation.') - }, :disable_gc_profiler => { :default => false, :public => true, @@ -1323,42 +1160,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :allowed_from_server => false, :description => 'If `true`, disables the use of GC::Profiler to measure time spent in garbage collection' }, - :disable_grape => { - :default => false, - :public => true, - :type => Boolean, - :allowed_from_server => false, - :deprecated => true, - :description => deprecated_description(:'instrumentation.grape', - 'If `true`, the agent won\'t install Grape instrumentation.') - }, - :disable_httpclient => { - :default => false, - :public => true, - :type => Boolean, - :dynamic_name => true, - :deprecated => true, - :allowed_from_server => false, - :description => deprecated_description(:'instrumentation.httpclient', 'If `true`, disables instrumentation for the httpclient gem.') - }, - :disable_httprb => { - :default => false, - :public => true, - :type => Boolean, - :dynamic_name => true, - :deprecated => true, - :allowed_from_server => false, - :description => deprecated_description(:'instrumentation.httprb', 'If `true`, the agent won\'t install instrumentation for the http.rb gem.') - }, - :disable_mongo => { - :default => false, - :public => true, - :type => Boolean, - :allowed_from_server => false, - :dynamic_name => true, - :deprecated => true, - :description => deprecated_description(:'instrumentation.mongo', 'If `true`, the agent won\'t install [instrumentation for the Mongo gem](/docs/agents/ruby-agent/frameworks/mongo-instrumentation).') - }, :disable_memory_sampler => { :default => false, :public => true, @@ -1374,78 +1175,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :allowed_from_server => false, :description => 'If `true`, the agent won\'t wrap third-party middlewares in instrumentation (regardless of whether they are installed via Rack::Builder or Rails).' }, - :disable_net_http => { - :default => false, - :public => true, - :type => Boolean, - :dynamic_name => true, - :allowed_from_server => false, - :deprecated => true, - :description => deprecated_description(:'instrumentation.net_http', - 'If `true`, disables instrumentation for Net::HTTP.') - }, - :disable_puma_rack => { - :default => value_of(:disable_rack), - :documentation_default => false, - :public => true, - :type => Boolean, - :dynamic_name => true, - :allowed_from_server => false, - :deprecated => true, - :description => deprecated_description(:'instrumentation.puma_rack', 'If `true`, prevents the agent from hooking into the `to_app` method in Puma::Rack::Builder to find gems to instrument during application startup.') - }, - :disable_puma_rack_urlmap => { - :default => value_of(:disable_rack_urlmap), - :documentation_default => false, - :public => true, - :type => Boolean, - :dynamic_name => true, - :allowed_from_server => false, - :deprecated => true, - :description => deprecated_description(:'instrumentation.puma_rack_urlmap', 'If `true`, prevents the agent from hooking into Puma::Rack::URLMap to install middleware tracing.') - }, - :disable_rack => { - :default => false, - :public => true, - :type => Boolean, - :dynamic_name => true, - :allowed_from_server => false, - :deprecated => true, - :description => deprecated_description(:'instrumentation.rack', 'If `true`, prevents the agent from hooking into the `to_app` method in Rack::Builder to find gems to instrument during application startup.') - }, - :disable_rack_urlmap => { - :default => false, - :public => true, - :type => Boolean, - :dynamic_name => true, - :allowed_from_server => false, - :deprecated => true, - :description => deprecated_description(:'instrumentation.rack_urlmap', 'If `true`, prevents the agent from hooking into Rack::URLMap to install middleware tracing.') - }, - :disable_rake => { - :default => false, - :public => true, - :type => Boolean, - :allowed_from_server => false, - :deprecated => true, - :description => deprecated_description(:'instrumentation.rake', 'If `true`, disables Rake instrumentation.') - }, - :disable_redis => { - :default => false, - :public => true, - :type => Boolean, - :deprecated => true, - :allowed_from_server => false, - :description => deprecated_description(:'instrumentation.redis', 'If `true`, the agent won\'t install [instrumentation for Redis](/docs/agents/ruby-agent/frameworks/redis-instrumentation).') - }, - :disable_resque => { - :default => false, - :public => true, - :type => Boolean, - :deprecated => true, - :allowed_from_server => false, - :description => deprecated_description(:'instrumentation.resque', 'If `true`, disables [Resque instrumentation](/docs/agents/ruby-agent/background-jobs/resque-instrumentation).') - }, :disable_samplers => { :default => false, :public => true, @@ -1467,14 +1196,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :allowed_from_server => false, :description => 'If `true`, disables [Sidekiq instrumentation](/docs/agents/ruby-agent/background-jobs/sidekiq-instrumentation).' }, - :disable_sinatra => { - :default => false, - :public => true, - :type => Boolean, - :deprecated => true, - :allowed_from_server => false, - :description => deprecated_description(:'instrumentation.sinatra', 'If `true` , disables [Sinatra instrumentation](/docs/agents/ruby-agent/frameworks/sinatra-support).') - }, :disable_sinatra_auto_middleware => { :default => false, :public => true, @@ -1499,15 +1220,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) DESCRIPTION }, - :disable_typhoeus => { - :default => false, - :public => true, - :type => Boolean, - :dynamic_name => true, - :deprecated => true, - :allowed_from_server => false, - :description => deprecated_description(:'instrumentation.typhoeus', 'If `true`, the agent won\'t install instrumentation for the typhoeus gem.') - }, :disable_view_instrumentation => { :default => false, :public => true, @@ -1593,8 +1305,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Controls auto-instrumentation of ActiveSupport::Logger at start up. May be one of [auto|prepend|chain|disabled].' }, :'instrumentation.bunny' => { - :default => instrumentation_value_of(:disable_bunny), - :documentation_default => 'auto', + :default => 'auto', :public => true, :type => String, :dynamic_name => true, @@ -1610,7 +1321,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Controls auto-instrumentation of the concurrent-ruby library at start up. May be one of [auto|prepend|chain|disabled].' }, :'instrumentation.curb' => { - :default => instrumentation_value_of(:disable_curb), + :default => 'auto', :documentation_default => 'auto', :public => true, :type => String, @@ -1619,7 +1330,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Controls auto-instrumentation of Curb at start up. May be one of [auto|prepend|chain|disabled].' }, :'instrumentation.delayed_job' => { - :default => instrumentation_value_of(:disable_dj), + :default => 'auto', :documentation_default => 'auto', :public => true, :type => String, @@ -1636,18 +1347,17 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Controls auto-instrumentation of the elasticsearch library at start up. May be one of [auto|prepend|chain|disabled].' }, :'instrumentation.excon' => { - :default => instrumentation_value_of(:disable_excon), + :default => 'enabled', :documentation_default => 'enabled', - :public => :true, + :public => true, :type => String, :dynamic_name => true, :allowed_from_server => false, :description => "Controls auto-instrumentation of Excon at start up. May be one of [enabled|disabled]." }, :'instrumentation.grape' => { - :default => instrumentation_value_of(:disable_grape_instrumentation), - :documentation_default => 'auto', - :public => :true, + :default => 'auto', + :public => true, :type => String, :dynamic_name => true, :allowed_from_server => false, @@ -1680,7 +1390,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Controls auto-instrumentation of gRPC servers at start up. May be one of [auto|prepend|chain|disabled].' }, :'instrumentation.httpclient' => { - :default => instrumentation_value_of(:disable_httpclient), + :default => 'auto', :documentation_default => 'auto', :public => true, :type => String, @@ -1689,7 +1399,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => "Controls auto-instrumentation of HTTPClient at start up. May be one of [auto|prepend|chain|disabled]." }, :'instrumentation.httprb' => { - :default => instrumentation_value_of(:disable_httprb), + :default => 'auto', :documentation_default => 'auto', :public => true, :type => String, @@ -1707,8 +1417,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Controls auto-instrumentation of Ruby standard library Logger at start up. May be one of [auto|prepend|chain|disabled].' }, :'instrumentation.memcache' => { - :default => instrumentation_value_of(:disable_dalli), - :documentation_default => 'auto', + :default => 'auto', :public => true, :type => String, :dynamic_name => true, @@ -1716,7 +1425,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Controls auto-instrumentation of dalli gem for Memcache at start up. May be one of [auto|prepend|chain|disabled].' }, :'instrumentation.memcached' => { - :default => instrumentation_value_of(:disable_memcached), + :default => 'auto', :documentation_default => 'auto', :public => true, :type => String, @@ -1734,16 +1443,16 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Controls auto-instrumentation of memcache-client gem for Memcache at start up. May be one of [auto|prepend|chain|disabled].' }, :'instrumentation.mongo' => { - :default => instrumentation_value_of(:disable_mongo), + :default => 'enabled', :documentation_default => 'enabled', - :public => :true, + :public => true, :type => String, :dynamic_name => true, :allowed_from_server => false, :description => "Controls auto-instrumentation of Mongo at start up. May be one of [enabled|disabled]." }, :'instrumentation.net_http' => { - :default => instrumentation_value_of(:disable_net_http, :prepend_net_instrumentation), + :default => 'auto', :documentation_default => 'auto', :public => true, :type => String, @@ -1752,7 +1461,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => "Controls auto-instrumentation of Net::HTTP at start up. May be one of [auto|prepend|chain|disabled]." }, :'instrumentation.puma_rack' => { - :default => instrumentation_value_of(:disable_puma_rack), # TODO: MAJOR VERSION - change to value_of(:'instrumentation.rack') when we remove :disable_puma_rack in 8.0) + :default => value_of(:'instrumentation.rack'), :documentation_default => 'auto', :public => true, :type => String, @@ -1763,7 +1472,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) "application startup. May be one of [auto|prepend|chain|disabled]." }, :'instrumentation.puma_rack_urlmap' => { - :default => instrumentation_value_of(:disable_puma_rack_urlmap), # TODO: MAJOR VERSION - change to value_of(:'instrumentation.rack_urlmap') when we remove :disable_puma_rack_urlmap in 8.0) + :default => value_of(:'instrumentation.rack_urlmap'), :documentation_default => 'auto', :public => true, :type => String, @@ -1772,7 +1481,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Controls auto-instrumentation of Puma::Rack::URLMap at start up. May be one of [auto|prepend|chain|disabled].' }, :'instrumentation.rack' => { - :default => instrumentation_value_of(:disable_rack), + :default => 'auto', :documentation_default => 'auto', :public => true, :type => String, @@ -1783,7 +1492,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) "application startup. May be one of [auto|prepend|chain|disabled]." }, :'instrumentation.rack_urlmap' => { - :default => instrumentation_value_of(:disable_rack_urlmap), + :default => 'auto', :documentation_default => 'auto', :public => true, :type => String, @@ -1792,17 +1501,15 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Controls auto-instrumentation of Rack::URLMap at start up. May be one of [auto|prepend|chain|disabled].' }, :'instrumentation.rake' => { - :default => instrumentation_value_of(:disable_rake), - :documentation_default => 'auto', - :public => :true, + :default => 'auto', + :public => true, :type => String, :dynamic_name => true, :allowed_from_server => false, :description => "Controls auto-instrumentation of rake at start up. May be one of [auto|prepend|chain|disabled]." }, :'instrumentation.redis' => { - :default => instrumentation_value_of(:disable_redis), - :documentation_default => 'auto', + :default => 'auto', :public => true, :type => String, :dynamic_name => true, @@ -1810,7 +1517,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => "Controls auto-instrumentation of Redis at start up. May be one of [auto|prepend|chain|disabled]." }, :'instrumentation.resque' => { - :default => instrumentation_value_of(:disable_resque), + :default => 'auto', :documentation_default => 'auto', :public => true, :type => String, @@ -1819,9 +1526,8 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => "Controls auto-instrumentation of resque at start up. May be one of [auto|prepend|chain|disabled]." }, :'instrumentation.sinatra' => { - :default => instrumentation_value_of(:disable_sinatra), - :documentation_default => 'auto', - :public => :true, + :default => 'auto', + :public => true, :type => String, :dynamic_name => true, :allowed_from_server => false, @@ -1858,7 +1564,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Controls auto-instrumentation of the Tilt template rendering library at start up. May be one of [auto|prepend|chain|disabled].' }, :'instrumentation.typhoeus' => { - :default => instrumentation_value_of(:disable_typhoeus), + :default => 'auto', :documentation_default => 'auto', :public => true, :type => String, @@ -1927,16 +1633,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :allowed_from_server => false, :description => 'Timeout for waiting on connect to complete before a rake task' }, - # Resque - :'resque.capture_params' => { - :default => false, - :public => true, - :type => Boolean, - :allowed_from_server => false, - :dynamic_name => true, - :deprecated => true, - :description => 'If `true`, enables the capture of job arguments for transaction traces and traced errors in Resque.' - }, # Rules :'rules.ignore_url_regexes' => { :default => [], @@ -1946,16 +1642,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :transform => DefaultSource.method(:convert_to_regexp_list), :description => 'Define transactions you want the agent to ignore, by specifying a list of patterns matching the URI you want to ignore. For more detail, see [the docs on ignoring specific transactions](/docs/agents/ruby-agent/api-guides/ignoring-specific-transactions/#config-ignoring).' }, - # Sidekiq - :'sidekiq.capture_params' => { - :default => false, - :public => true, - :type => Boolean, - :allowed_from_server => false, - :dynamic_name => true, - :deprecated => true, - :description => 'If `true`, enables the capture of job arguments for transaction traces and traced errors in Sidekiq.' - }, # Slow SQL :'slow_sql.enabled' => { :default => value_of(:'transaction_tracer.enabled'), @@ -2144,7 +1830,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :description => 'Real user monitoring license key for the browser timing header.' }, :'browser_monitoring.loader' => { - :default => DefaultSource.browser_monitoring_loader, + :default => 'rum', :public => false, :type => String, :allowed_from_server => true, @@ -2200,15 +1886,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :allowed_from_server => true, :description => 'Number of seconds betwixt connections to the New Relic data collection service.' }, - :disable_grape_instrumentation => { - :default => false, - :public => false, - :type => Boolean, - :allowed_from_server => false, - :deprecated => true, - :description => deprecated_description(:'instrumentation.grape', - 'If `true`, the agent won\'t install Grape instrumentation.') - }, :dispatcher => { :default => DefaultSource.dispatcher, :public => false, @@ -2230,31 +1907,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :allowed_from_server => false, :description => 'Internal name for controlling Rails 3+ middleware instrumentation' }, - :disable_rake_instrumentation => { - :default => false, - :public => false, - :type => Boolean, - :allowed_from_server => false, - :deprecated => true, - :description => deprecated_description(:'instrumentation.rake', 'Enable or disable Rake instrumentation. Preferred key is `disable_rake`') - }, - :disable_redis_instrumentation => { - :default => false, - :public => false, - :type => Boolean, - :deprecated => true, - :allowed_from_server => false, - :description => deprecated_description(:'instrumentation.redis', 'Disables installation of Redis instrumentation. Standard key to use is disable_redis.') - }, - :cross_application_tracing => { - :default => nil, - :allow_nil => true, - :public => false, - :type => Boolean, - :allowed_from_server => false, - :deprecated => true, - :description => 'Deprecated in favor of distributed_tracing.enabled' - }, :enabled => { :default => true, :public => false, @@ -2292,17 +1944,8 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :allowed_from_server => true, :description => 'Number of seconds betwixt connections to the New Relic event collection services.' }, - :'event_report_period.analytic_event_data' => { - :default => 60, - :public => false, - :type => Integer, - :dynamic_name => true, - :deprecated => true, - :allowed_from_server => true, - :description => deprecated_description(:'event_report_period.transaction_event_data', 'Number of seconds betwixt connections to the New Relic transaction event collection services.') - }, :'event_report_period.transaction_event_data' => { - :default => value_of(:'event_report_period.analytic_event_data'), + :default => 60, :public => false, :type => Integer, :dynamic_name => true, @@ -2394,14 +2037,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :allowed_from_server => true, :description => 'JavaScript agent loader content.' }, - :js_errors_beta => { - :default => false, - :public => false, - :type => Boolean, - :allowed_from_server => false, - :deprecated => true, - :description => 'Enable or disable beta JavaScript error reporting.' - }, :keep_alive_timeout => { :default => 60, :public => false, @@ -2409,14 +2044,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :allowed_from_server => true, :description => 'Timeout for keep alive on TCP connection to collector if supported by Ruby version. Only used in conjunction when aggressive_keepalive is enabled.' }, - :keep_retrying => { - :default => true, - :public => false, - :type => Boolean, - :deprecated => true, - :allowed_from_server => false, - :description => 'Enable or disable retrying failed connections to the New Relic data collection service.' - }, :max_payload_size_in_bytes => { :default => 1000000, :public => false, @@ -2438,15 +2065,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :allowed_from_server => false, :description => 'Port for the New Relic data collection service.' }, - :prepend_net_instrumentation => { - :default => true, - :public => false, - :type => Boolean, - :allowed_from_server => false, - :deprecated => true, - :description => deprecated_description(:'instrumentation.net_http', - 'If `true`, uses `Module#prepend` rather than alias_method for Net::HTTP instrumentation.') - }, :primary_application_id => { :default => nil, :allow_nil => true, diff --git a/lib/new_relic/agent/configuration/high_security_source.rb b/lib/new_relic/agent/configuration/high_security_source.rb index 9334a87934..23f7a0a205 100644 --- a/lib/new_relic/agent/configuration/high_security_source.rb +++ b/lib/new_relic/agent/configuration/high_security_source.rb @@ -11,8 +11,6 @@ class HighSecuritySource < DottedHash def initialize(local_settings) super({ :capture_params => false, - :'resque.capture_params' => false, - :'sidekiq.capture_params' => false, :'attributes.include' => [], :'transaction_tracer.record_sql' => record_sql_setting(local_settings, :'transaction_tracer.record_sql'), diff --git a/lib/new_relic/agent/configuration/security_policy_source.rb b/lib/new_relic/agent/configuration/security_policy_source.rb index c462976d88..d21132cbf7 100644 --- a/lib/new_relic/agent/configuration/security_policy_source.rb +++ b/lib/new_relic/agent/configuration/security_policy_source.rb @@ -191,22 +191,6 @@ def change_setting(policies, option, new_value) disabled_value: false, permitted_fn: nil } - ], - "job_arguments" => [ - { - option: :'resque.capture_params', - supported: true, - enabled_fn: method(:enabled?), - disabled_value: false, - permitted_fn: nil - }, - { - option: :'sidekiq.capture_params', - supported: true, - enabled_fn: method(:enabled?), - disabled_value: false, - permitted_fn: nil - } ] } diff --git a/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb b/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb index 0166ec182e..456098818d 100644 --- a/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +++ b/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb @@ -166,8 +166,7 @@ def valid_encoding_key? def cross_application_tracer_enabled? !NewRelic::Agent.config[:"distributed_tracing.enabled"] && - (NewRelic::Agent.config[:"cross_application_tracer.enabled"] || - NewRelic::Agent.config[:cross_application_tracing]) + NewRelic::Agent.config[:"cross_application_tracer.enabled"] end def obfuscator diff --git a/lib/new_relic/agent/error_collector.rb b/lib/new_relic/agent/error_collector.rb index bf88dcb8cc..3edb728afb 100644 --- a/lib/new_relic/agent/error_collector.rb +++ b/lib/new_relic/agent/error_collector.rb @@ -26,7 +26,7 @@ def initialize(events) @error_filter = NewRelic::Agent::ErrorFilter.new %w[ - ignore_errors ignore_classes ignore_messages ignore_status_codes + ignore_classes ignore_messages ignore_status_codes expected_classes expected_messages expected_status_codes ].each do |w| Agent.config.register_callback(:"error_collector.#{w}") do |value| diff --git a/lib/new_relic/agent/error_filter.rb b/lib/new_relic/agent/error_filter.rb index ce8d7110e7..dd2c49da9a 100644 --- a/lib/new_relic/agent/error_filter.rb +++ b/lib/new_relic/agent/error_filter.rb @@ -19,7 +19,7 @@ def reset def load_all %i[ - ignore_errors ignore_classes ignore_messages ignore_status_codes + ignore_classes ignore_messages ignore_status_codes expected_classes expected_messages expected_status_codes ].each { |setting| load_from_config(setting) } end @@ -31,7 +31,7 @@ def load_from_config(setting, value = nil) return if new_value.nil? || (new_value.respond_to?(:empty?) && new_value.empty?) case setting.to_sym - when :ignore_errors, :ignore_classes + when :ignore_classes new_value = new_value.split(',').map!(&:strip) if new_value.is_a?(String) errors = @ignore_classes = new_value when :ignore_messages @@ -120,7 +120,7 @@ def expect(*args) def log_filter(setting, errors) case setting - when :ignore_errors, :ignore_classes + when :ignore_classes errors.each do |error| ::NewRelic::Agent.logger.debug("Ignoring errors of type '#{error}'") end diff --git a/lib/new_relic/agent/instrumentation/grape.rb b/lib/new_relic/agent/instrumentation/grape.rb index 5e10601ca4..e5624390ba 100644 --- a/lib/new_relic/agent/instrumentation/grape.rb +++ b/lib/new_relic/agent/instrumentation/grape.rb @@ -9,7 +9,7 @@ DependencyDetection.defer do # Why not just :grape? newrelic-grape used that name already, and while we're # not shipping yet, overloading the name interferes with the plugin. - named :grape_instrumentation + @name = :grape_instrumentation configure_with :grape depends_on do diff --git a/lib/new_relic/agent/instrumentation/memcache.rb b/lib/new_relic/agent/instrumentation/memcache.rb index b0cdfa7a28..f61a719aa9 100644 --- a/lib/new_relic/agent/instrumentation/memcache.rb +++ b/lib/new_relic/agent/instrumentation/memcache.rb @@ -46,7 +46,7 @@ end DependencyDetection.defer do - named :dalli + @name = :dalli configure_with :memcache depends_on { defined? Dalli::Client } @@ -67,7 +67,7 @@ # dalli/cas/client. Use a separate dependency block so it can potentially # re-evaluate after they've done that require. DependencyDetection.defer do - named :dalli_cas_client + @name = :dalli_cas_client configure_with :memcache depends_on { defined? Dalli::Client } diff --git a/lib/new_relic/agent/instrumentation/rake.rb b/lib/new_relic/agent/instrumentation/rake.rb index 3432183ae7..579ad32661 100644 --- a/lib/new_relic/agent/instrumentation/rake.rb +++ b/lib/new_relic/agent/instrumentation/rake.rb @@ -8,7 +8,7 @@ DependencyDetection.defer do # Why not :rake? newrelic-rake used that name, so avoid conflicting - named :rake_instrumentation + @name = :rake_instrumentation configure_with :rake depends_on { defined?(Rake) && defined?(Rake::VERSION) } diff --git a/lib/new_relic/agent/instrumentation/redis.rb b/lib/new_relic/agent/instrumentation/redis.rb index 09a897deae..ef609676ab 100644 --- a/lib/new_relic/agent/instrumentation/redis.rb +++ b/lib/new_relic/agent/instrumentation/redis.rb @@ -13,7 +13,7 @@ DependencyDetection.defer do # Why not :redis? newrelic-redis used that name, so avoid conflicting - named :redis_instrumentation + @name = :redis_instrumentation configure_with :redis depends_on do diff --git a/lib/new_relic/agent/instrumentation/resque.rb b/lib/new_relic/agent/instrumentation/resque.rb index e62d4cdcde..8ccd3a8933 100644 --- a/lib/new_relic/agent/instrumentation/resque.rb +++ b/lib/new_relic/agent/instrumentation/resque.rb @@ -10,7 +10,7 @@ @name = :resque depends_on do - defined?(Resque::Job) && !NewRelic::Agent.config[:disable_resque] + defined?(Resque::Job) end # Airbrake uses method chaining on Resque::Job on versions < 11.0.3 diff --git a/lib/new_relic/agent/instrumentation/sequel.rb b/lib/new_relic/agent/instrumentation/sequel.rb index 853589ee6a..da5923d739 100644 --- a/lib/new_relic/agent/instrumentation/sequel.rb +++ b/lib/new_relic/agent/instrumentation/sequel.rb @@ -11,8 +11,7 @@ end depends_on do - !NewRelic::Agent.config[:disable_sequel_instrumentation] && - !NewRelic::Agent.config[:disable_database_instrumentation] + !NewRelic::Agent.config[:disable_sequel_instrumentation] end def supported_sequel_version? diff --git a/lib/new_relic/agent/new_relic_service/security_policy_settings.rb b/lib/new_relic/agent/new_relic_service/security_policy_settings.rb index 5bb0e68354..134fe4fb23 100644 --- a/lib/new_relic/agent/new_relic_service/security_policy_settings.rb +++ b/lib/new_relic/agent/new_relic_service/security_policy_settings.rb @@ -14,7 +14,6 @@ module SecurityPolicySettings custom_parameters custom_instrumentation_editor message_parameters - job_arguments ].map(&:freeze) def self.preliminary_settings(security_policies) diff --git a/lib/new_relic/agent/samplers/delayed_job_sampler.rb b/lib/new_relic/agent/samplers/delayed_job_sampler.rb index f600d54e38..5e680e6f32 100644 --- a/lib/new_relic/agent/samplers/delayed_job_sampler.rb +++ b/lib/new_relic/agent/samplers/delayed_job_sampler.rb @@ -25,7 +25,7 @@ def self.supported_backend? end def initialize - raise Unsupported, "DJ queue sampler disabled" if Agent.config[:disable_dj] + raise Unsupported, "DJ queue sampler disabled" if Agent.config[:'instrumentation.delayed_job'] == 'disabled' raise Unsupported, "DJ queue sampling unsupported with backend '#{::Delayed::Worker.backend}'" unless self.class.supported_backend? raise Unsupported, "No DJ worker present. Skipping DJ queue sampler" unless NewRelic::DelayedJobInjection.worker_name end diff --git a/test/multiverse/suites/rails/config/newrelic.yml b/test/multiverse/suites/rails/config/newrelic.yml index 26cc22e26c..fc37843d5b 100644 --- a/test/multiverse/suites/rails/config/newrelic.yml +++ b/test/multiverse/suites/rails/config/newrelic.yml @@ -15,7 +15,7 @@ common: &default_settings stack_trace_threshold: 0.500 error_collector: enabled: true - ignore_errors: NewRelic::TestHelpers::Exceptions::IgnoredError + ignore_classes: NewRelic::TestHelpers::Exceptions::IgnoredError development: <<: *default_settings diff --git a/test/multiverse/suites/rails/error_tracing_test.rb b/test/multiverse/suites/rails/error_tracing_test.rb index ade020c2ce..3a866b2d11 100644 --- a/test/multiverse/suites/rails/error_tracing_test.rb +++ b/test/multiverse/suites/rails/error_tracing_test.rb @@ -304,18 +304,6 @@ def test_captured_errors_should_not_include_custom_params_if_config_says_no end end - def test_captured_errors_should_not_include_custom_params_if_legacy_setting_says_no - with_config(:'error_collector.capture_attributes' => false) do - get('/error/error_with_custom_params') - - assert_error_reported_once('bad things') - - attributes = user_attributes_for_single_error_posted - - assert_empty attributes - end - end - def test_should_not_increment_metrics_on_expected_error_errors get('/error/noticed_error_with_expected_error') @@ -366,7 +354,7 @@ def setup_collector_mocks $collector.stub('connect', { "agent_run_id" => 1, "agent_config" => { - "error_collector.ignore_errors" => 'NewRelic::TestHelpers::Exceptions::IgnoredError,NewRelic::TestHelpers::Exceptions::ServerIgnoredError', + "error_collector.ignore_classes" => ['NewRelic::TestHelpers::Exceptions::IgnoredError', 'NewRelic::TestHelpers::Exceptions::ServerIgnoredError'], "error_collector.enabled" => true }, "collect_errors" => true diff --git a/test/multiverse/suites/rails/request_statistics_test.rb b/test/multiverse/suites/rails/request_statistics_test.rb index 65d2d91001..001fd0d6e1 100644 --- a/test/multiverse/suites/rails/request_statistics_test.rb +++ b/test/multiverse/suites/rails/request_statistics_test.rb @@ -34,7 +34,7 @@ class RequestStatsTest < ActionDispatch::IntegrationTest # def test_doesnt_send_when_disabled - with_config(:'analytics_events.enabled' => false) do + with_config(:'transaction_events.enabled' => false) do 5.times { get('/request_stats/stats_action') } NewRelic::Agent.agent.send(:harvest_and_send_analytic_event_data) @@ -44,7 +44,7 @@ def test_doesnt_send_when_disabled end def test_request_times_should_be_reported_if_enabled - with_config(:'analytics_events.enabled' => true) do + with_config(:'transaction_events.enabled' => true) do 5.times { get('/request_stats/stats_action') } NewRelic::Agent.agent.send(:harvest_and_send_analytic_event_data) diff --git a/test/multiverse/suites/rake/rake_test.rb b/test/multiverse/suites/rake/rake_test.rb index 4872cf3569..8cc9b8fb47 100644 --- a/test/multiverse/suites/rake/rake_test.rb +++ b/test/multiverse/suites/rake/rake_test.rb @@ -12,7 +12,7 @@ class RakeTest < Minitest::Test setup_and_teardown_agent def test_disabling_rake_instrumentation - with_environment("NEW_RELIC_DISABLE_RAKE" => "true", + with_environment("NEW_RELIC_INSTRUMENTATION_RAKE" => "disabled", "NEW_RELIC_SYNC_STARTUP" => "true") do run_rake end diff --git a/test/multiverse/suites/resque/instrumentation_test.rb b/test/multiverse/suites/resque/instrumentation_test.rb index fca8131ff0..ebc9856270 100644 --- a/test/multiverse/suites/resque/instrumentation_test.rb +++ b/test/multiverse/suites/resque/instrumentation_test.rb @@ -95,17 +95,6 @@ def test_isnt_influenced_by_global_capture_params refute_attributes_on_events end - def test_agent_posts_captured_args_to_job - stub_for_span_collection - - with_config(:'resque.capture_params' => true) do - run_jobs - end - - assert_attributes_on_transaction_traces - refute_attributes_on_events - end - def test_arguments_are_captured_on_transaction_and_span_events_when_enabled stub_for_span_collection @@ -113,6 +102,7 @@ def test_arguments_are_captured_on_transaction_and_span_events_when_enabled run_jobs end + assert_attributes_on_transaction_traces assert_attributes_on_events end diff --git a/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb b/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb index bab31f0a45..377cf1bcfe 100644 --- a/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb +++ b/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb @@ -152,17 +152,6 @@ def test_isnt_influenced_by_global_capture_params refute_attributes_on_events end - def test_agent_posts_captured_args_to_job - stub_for_span_collection - - with_config(:'sidekiq.capture_params' => true) do - run_jobs - end - - assert_attributes_on_transaction_trace - refute_attributes_on_events - end - def test_arguments_are_captured_on_transaction_and_span_events_when_enabled stub_for_span_collection @@ -170,6 +159,7 @@ def test_arguments_are_captured_on_transaction_and_span_events_when_enabled run_jobs end + assert_attributes_on_transaction_trace assert_attributes_on_events end diff --git a/test/new_relic/agent/agent/connect_test.rb b/test/new_relic/agent/agent/connect_test.rb index f291ddab77..be39dd51f3 100644 --- a/test/new_relic/agent/agent/connect_test.rb +++ b/test/new_relic/agent/agent/connect_test.rb @@ -164,7 +164,7 @@ def test_connect_memoizes_event_harvest_config default_source = NewRelic::Agent::Configuration::DefaultSource.new expected_event_harvest_config_payload = { :harvest_limits => { - :analytic_event_data => default_source[:'analytics_events.max_samples_stored'], + :analytic_event_data => default_source[:'transaction_events.max_samples_stored'], :custom_event_data => default_source[:'custom_insights_events.max_samples_stored'], :error_event_data => default_source[:'error_collector.max_event_samples_stored'], :span_event_data => default_source[:'span_events.max_samples_stored'], diff --git a/test/new_relic/agent/attribute_filter_test.rb b/test/new_relic/agent/attribute_filter_test.rb index d23430af8d..796b221f69 100644 --- a/test/new_relic/agent/attribute_filter_test.rb +++ b/test/new_relic/agent/attribute_filter_test.rb @@ -85,7 +85,7 @@ def test_capture_params_true_allows_request_params_for_traces_and_errors end def test_resque_capture_params_false_adds_exclude_rule_for_request_parameters - with_config(:'resque.capture_params' => false) do + with_config(:'attributes.include' => []) do filter = AttributeFilter.new(NewRelic::Agent.config) result = filter.apply('job.resque.args.*', AttributeFilter::DST_NONE) @@ -94,16 +94,24 @@ def test_resque_capture_params_false_adds_exclude_rule_for_request_parameters end def test_resque_capture_params_true_allows_request_params_for_traces_and_errors - with_config(:'resque.capture_params' => true) do + with_config(:'attributes.include' => ['job.resque.args.*']) do filter = AttributeFilter.new(NewRelic::Agent.config) result = filter.apply('job.resque.args.*', AttributeFilter::DST_NONE) - assert_destinations %w[transaction_tracer error_collector], result + expected_destinations = %w[ + transaction_events + transaction_tracer + error_collector + span_events + transaction_segments + ] + + assert_destinations expected_destinations, result end end def test_sidekiq_capture_params_false_adds_exclude_rule_for_request_parameters - with_config(:'sidekiq.capture_params' => false) do + with_config(:'attributes.include' => []) do filter = AttributeFilter.new(NewRelic::Agent.config) result = filter.apply('job.sidekiq.args.*', AttributeFilter::DST_NONE) @@ -112,11 +120,19 @@ def test_sidekiq_capture_params_false_adds_exclude_rule_for_request_parameters end def test_sidekiq_capture_params_true_allows_request_params_for_traces_errors - with_config(:'sidekiq.capture_params' => true) do + with_config(:'attributes.include' => 'job.sidekiq.args.*') do filter = AttributeFilter.new(NewRelic::Agent.config) result = filter.apply('job.sidekiq.args.*', AttributeFilter::DST_NONE) - assert_destinations %w[transaction_tracer error_collector], result + expected_destinations = %w[ + transaction_events + transaction_tracer + error_collector + span_events + transaction_segments + ] + + assert_destinations expected_destinations, result end end diff --git a/test/new_relic/agent/configuration/default_source_test.rb b/test/new_relic/agent/configuration/default_source_test.rb index 5c8e5c5ed3..009ef7b0c4 100644 --- a/test/new_relic/agent/configuration/default_source_test.rb +++ b/test/new_relic/agent/configuration/default_source_test.rb @@ -139,30 +139,6 @@ def test_config_search_path_in_warbler end end - def test_transaction_tracer_attributes_enabled_default - with_config(:'transaction_tracer.capture_attributes' => :foo) do - assert_equal :foo, NewRelic::Agent.config['transaction_tracer.attributes.enabled'] - end - end - - def test_transaction_events_attributes_enabled_default - with_config(:'analytics_events.capture_attributes' => :foo) do - assert_equal :foo, NewRelic::Agent.config['transaction_events.attributes.enabled'] - end - end - - def test_error_collector_attributes_enabled_default - with_config(:'error_collector.capture_attributes' => :foo) do - assert_equal :foo, NewRelic::Agent.config['error_collector.attributes.enabled'] - end - end - - def test_browser_monitoring_attributes_enabled_default - with_config(:'browser_monitoring.capture_attributes' => :foo) do - assert_equal :foo, NewRelic::Agent.config['browser_monitoring.attributes.enabled'] - end - end - def test_application_logging_enabled_default with_config(:'application_logging.enabled' => :foo) do assert_equal :foo, NewRelic::Agent.config['application_logging.enabled'] diff --git a/test/new_relic/agent/configuration/manager_test.rb b/test/new_relic/agent/configuration/manager_test.rb index 6c7509dc2d..2b183ca1f0 100644 --- a/test/new_relic/agent/configuration/manager_test.rb +++ b/test/new_relic/agent/configuration/manager_test.rb @@ -437,14 +437,6 @@ def test_prepend_key_absent_to_instrumentation_value_of end end - def test_prepend_key_false_to_instrumentation_value_of - with_config({:prepend_net_instrumentation => false}) do - result = @manager.fetch(:'instrumentation.net_http') - - assert_equal "chain", result - end - end - def test_prepend_key_true_to_instrumentation_value_of with_config(:prepend_net_instrumentation => true) do result = @manager.fetch(:'instrumentation.net_http') diff --git a/test/new_relic/agent/configuration/security_policy_source_test.rb b/test/new_relic/agent/configuration/security_policy_source_test.rb index cd2a6ac957..49c547bca2 100644 --- a/test/new_relic/agent/configuration/security_policy_source_test.rb +++ b/test/new_relic/agent/configuration/security_policy_source_test.rb @@ -177,33 +177,10 @@ def test_message_parameters_disabled end end - def test_job_arguments_enabled - policies = generate_security_policies(default: false, enabled: ['job_arguments']) - with_config(:'resque.capture_params' => true, - :'sidekiq.capture_params' => true) do - source = SecurityPolicySource.new(policies) - - refute_includes source.keys, :'resque.capture_params' - refute_includes source.keys, :'sidekiq.capture_params' - end - end - - def test_job_arguments_disabled - policies = generate_security_policies(default: true, disabled: ['job_arguments']) - with_config(:'resque.capture_params' => true, - :'sidekiq.capture_params' => true) do - source = SecurityPolicySource.new(policies) - - refute source[:'resque.capture_params'] - refute source[:'sidekiq.capture_params'] - end - end - def generate_security_policies(default: false, enabled: [], disabled: [], required: []) policies = { "record_sql" => {"enabled" => default, "required" => false, "position" => 0}, "custom_events" => {"enabled" => default, "required" => false, "position" => 3}, - "job_arguments" => {"enabled" => default, "required" => false, "position" => 7}, "custom_parameters" => {"enabled" => default, "required" => false, "position" => 4}, "attributes_include" => {"enabled" => default, "required" => false, "position" => 1}, "message_parameters" => {"enabled" => default, "required" => false, "position" => 6}, diff --git a/test/new_relic/agent/distributed_tracing/trace_context_cross_agent_test.rb b/test/new_relic/agent/distributed_tracing/trace_context_cross_agent_test.rb index aa4f9f363a..8e2b908a20 100644 --- a/test/new_relic/agent/distributed_tracing/trace_context_cross_agent_test.rb +++ b/test/new_relic/agent/distributed_tracing/trace_context_cross_agent_test.rb @@ -49,7 +49,7 @@ def self.focus_tests :'distributed_tracing.enabled' => true, :account_id => test_case['account_id'], :primary_application_id => "2827902", - :'analytics_events.enabled' => test_case.fetch('transaction_events_enabled', true), + :'transaction_events.enabled' => test_case.fetch('transaction_events_enabled', true), :trusted_account_key => test_case['trusted_account_key'], :'span_events.enabled' => test_case.fetch('span_events_enabled', true) } diff --git a/test/new_relic/agent/error_collector_test.rb b/test/new_relic/agent/error_collector_test.rb index d94d544e26..b6bbadba02 100644 --- a/test/new_relic/agent/error_collector_test.rb +++ b/test/new_relic/agent/error_collector_test.rb @@ -70,7 +70,7 @@ def test_exclude_later_config_changes @error_collector.notice_error(IOError.new("message")) end - NewRelic::Agent.config.add_config_for_testing(:'error_collector.ignore_errors' => "IOError") + NewRelic::Agent.config.add_config_for_testing(:'error_collector.ignore_classes' => ["IOError"]) in_transaction do @error_collector.notice_error(IOError.new("message")) @@ -359,16 +359,6 @@ def test_skip_notice_error_returns_false_for_non_nil_unignored_errors_with_an_en class ::AnError end - def test_ignore_error - error = AnError.new - - with_config(:'error_collector.ignore_errors' => 'AnError') do - assert @error_collector.ignore?(error) - end - - refute @error_collector.ignore?(error) - end - def test_ignored_and_expected_error_is_ignored with_config(:'error_collector.ignore_classes' => ['AnError'], :'error_collector.expected_classes' => ['AnError']) do @@ -587,7 +577,7 @@ def test_segment_error_attributes_for_tx_notice_error_api_call end def test_segment_error_filtered - with_config(:'error_collector.ignore_errors' => 'StandardError') do + with_config(:'error_collector.ignore_classes' => ['StandardError']) do with_segment do |segment| @error_collector.notice_segment_error(segment, StandardError.new("Oops!")) diff --git a/test/new_relic/agent/error_filter_test.rb b/test/new_relic/agent/error_filter_test.rb index d1b448294e..a73a8ab7d1 100644 --- a/test/new_relic/agent/error_filter_test.rb +++ b/test/new_relic/agent/error_filter_test.rb @@ -110,16 +110,6 @@ def test_ignore_integer_status_codes end end - # compatibility for deprecated config setting - def test_ignore_errors - with_config(:'error_collector.ignore_errors' => 'TestExceptionA,TestExceptionC') do - @error_filter.load_all - - assert @error_filter.ignore?(TestExceptionA.new) - refute @error_filter.ignore?(TestExceptionB.new) - end - end - def test_expected_classes with_config(:'error_collector.expected_classes' => %w[TestExceptionA TestExceptionC]) do @error_filter.load_all diff --git a/test/new_relic/agent/javascript_instrumentor_test.rb b/test/new_relic/agent/javascript_instrumentor_test.rb index b22d822c44..67422941d0 100644 --- a/test/new_relic/agent/javascript_instrumentor_test.rb +++ b/test/new_relic/agent/javascript_instrumentor_test.rb @@ -34,22 +34,10 @@ def teardown NewRelic::Agent.config.reset_to_defaults end - def test_js_errors_beta_default_gets_default_loader + def test_default_loader assert_equal "rum", NewRelic::Agent.config[:'browser_monitoring.loader'] end - def test_js_errors_beta_gets_full_loader - with_config(:js_errors_beta => true) do - assert_equal "full", NewRelic::Agent.config[:'browser_monitoring.loader'] - end - end - - def test_js_errors_beta_off_gets_default_loader - with_config(:js_errors_beta => false) do - assert_equal "rum", NewRelic::Agent.config[:'browser_monitoring.loader'] - end - end - def test_auto_instrumentation_config_defaults_to_enabled assert NewRelic::Agent.config[:'browser_monitoring.auto_instrument'] end @@ -158,7 +146,7 @@ def test_browser_timing_header_safe_when_json_dump_fails def test_config_data_for_js_agent nr_freeze_process_time - with_config(CAPTURE_ATTRIBUTES => true) do + with_config(ATTRIBUTES_ENABLED => true) do in_transaction('most recent transaction') do txn = NewRelic::Agent::Transaction.tl_current txn.stubs(:queue_time).returns(0) @@ -190,7 +178,7 @@ def test_config_data_for_js_agent def test_config_data_for_js_agent_attributes nr_freeze_process_time - with_config(CAPTURE_ATTRIBUTES => true) do + with_config(ATTRIBUTES_ENABLED => true) do in_transaction('most recent transaction') do |txn| NewRelic::Agent.add_custom_attributes(:user => "user") NewRelic::Agent::Transaction.add_agent_attribute(:agent, "attribute", NewRelic::Agent::AttributeFilter::DST_ALL) @@ -238,7 +226,6 @@ def test_ssl_for_http_disabled end ATTRIBUTES_ENABLED = :'browser_monitoring.attributes.enabled' - CAPTURE_ATTRIBUTES = :'browser_monitoring.capture_attributes' def test_data_for_js_agent_doesnt_get_custom_attributes_by_default with_config({}) do @@ -251,7 +238,7 @@ def test_data_for_js_agent_doesnt_get_custom_attributes_by_default end def test_data_for_js_agent_doesnt_get_custom_attributes_outside_transaction - with_config(CAPTURE_ATTRIBUTES => true) do + with_config(ATTRIBUTES_ENABLED => true) do NewRelic::Agent.add_custom_attributes({:boo => "hoo"}) assert_attributes_missing @@ -259,7 +246,7 @@ def test_data_for_js_agent_doesnt_get_custom_attributes_outside_transaction end def test_data_for_js_agent_gets_custom_attributes_with_old_config - with_config(CAPTURE_ATTRIBUTES => true) do + with_config(ATTRIBUTES_ENABLED => true) do in_transaction do NewRelic::Agent.add_custom_attributes({:boo => "hoo"}) @@ -279,7 +266,7 @@ def test_data_for_js_agent_gets_custom_attributes_when_configured end def test_data_for_js_agent_ignores_custom_attributes_by_config - with_config(CAPTURE_ATTRIBUTES => false) do + with_config(ATTRIBUTES_ENABLED => false) do in_transaction do NewRelic::Agent.add_custom_attributes({:boo => "hoo"}) diff --git a/test/new_relic/agent/monitors/cross_app_monitor_test.rb b/test/new_relic/agent/monitors/cross_app_monitor_test.rb index 64c4e8b18e..96776c0970 100644 --- a/test/new_relic/agent/monitors/cross_app_monitor_test.rb +++ b/test/new_relic/agent/monitors/cross_app_monitor_test.rb @@ -104,7 +104,7 @@ def test_doesnt_add_header_if_no_id_on_agent end def test_doesnt_add_header_if_config_disabled - with_config(:"cross_application_tracer.enabled" => false, :cross_application_tracing => false) do + with_config(:"cross_application_tracer.enabled" => false) do when_request_runs assert_nil response_app_data diff --git a/test/new_relic/agent/new_relic_service/security_policy_settings_test.rb b/test/new_relic/agent/new_relic_service/security_policy_settings_test.rb index deb34918ff..adc3e96515 100644 --- a/test/new_relic/agent/new_relic_service/security_policy_settings_test.rb +++ b/test/new_relic/agent/new_relic_service/security_policy_settings_test.rb @@ -13,7 +13,6 @@ def test_preliminary_settings policies = { "record_sql" => {"enabled" => false, "required" => false, "position" => 0}, "custom_events" => {"enabled" => false, "required" => false, "position" => 3}, - "job_arguments" => {"enabled" => false, "required" => false, "position" => 7}, "custom_parameters" => {"enabled" => false, "required" => false, "position" => 4}, "attributes_include" => {"enabled" => false, "required" => false, "position" => 1}, "message_parameters" => {"enabled" => false, "required" => false, "position" => 6}, @@ -25,7 +24,6 @@ def test_preliminary_settings "security_policies" => { "record_sql" => {"enabled" => false}, "custom_events" => {"enabled" => false}, - "job_arguments" => {"enabled" => false}, "custom_parameters" => {"enabled" => false}, "attributes_include" => {"enabled" => false}, "message_parameters" => {"enabled" => false}, diff --git a/test/new_relic/agent/transaction/trace_context_test.rb b/test/new_relic/agent/transaction/trace_context_test.rb index da285f1ef1..78083ed89f 100644 --- a/test/new_relic/agent/transaction/trace_context_test.rb +++ b/test/new_relic/agent/transaction/trace_context_test.rb @@ -360,19 +360,19 @@ def test_creates_trace_context_payload assert_equal now_ms, payload.timestamp end - def test_omits_transaction_guid_from_payload_when_analytics_events_disabled + def test_omits_transaction_guid_from_payload_when_atransaction_events_disabled nr_freeze_process_time payload = nil parent_id = nil now_ms = Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond) - disabled_analytics_events = @config.merge({ - :'analytics_events.enabled' => false + disabled_transaction_events = @config.merge({ + :'transaction_events.enabled' => false }) - with_config(disabled_analytics_events) do - refute Agent.config[:'analytics_events.enabled'] + with_config(disabled_transaction_events) do + refute Agent.config[:'transaction_events.enabled'] txn = in_transaction do |t| t.sampled = true payload = t.distributed_tracer.create_trace_state_payload diff --git a/test/new_relic/agent/transaction_event_primitive_test.rb b/test/new_relic/agent/transaction_event_primitive_test.rb index 37b56c7b4b..a927da471f 100644 --- a/test/new_relic/agent/transaction_event_primitive_test.rb +++ b/test/new_relic/agent/transaction_event_primitive_test.rb @@ -96,26 +96,6 @@ def test_doesnt_include_agent_attributes_in_event_when_configured_not_to end end - def test_doesnt_include_custom_attributes_in_event_when_configured_not_to_with_legacy_setting - with_config('analytics_events.capture_attributes' => false) do - attributes.merge_custom_attributes('bing' => 2) - - _, custom_attrs, _ = TransactionEventPrimitive.create(generate_payload) - - assert_empty custom_attrs - end - end - - def test_doesnt_include_agent_attributes_in_event_when_configured_not_to_with_legacy_setting - with_config('analytics_events.capture_attributes' => false) do - attributes.add_agent_attribute('bing', 2, NewRelic::Agent::AttributeFilter::DST_ALL) - - _, _, agent_attrs = TransactionEventPrimitive.create(generate_payload) - - assert_empty agent_attrs - end - end - def test_custom_attributes_in_event_cant_override_reserved_attributes metrics = NewRelic::Agent::TransactionMetrics.new() metrics.record_unscoped('HttpDispatcher', 0.01) diff --git a/test/new_relic/agent/transaction_test.rb b/test/new_relic/agent/transaction_test.rb index 83e9074336..f8f5b651da 100644 --- a/test/new_relic/agent/transaction_test.rb +++ b/test/new_relic/agent/transaction_test.rb @@ -341,7 +341,7 @@ def test_apdex_success_with_ignored_error def test_apdex_success_with_config_ignored_error txn_name = 'Controller/whatever' - with_config(:'error_collector.ignore_errors' => SillyError.name) do + with_config(:'error_collector.ignore_classes' => [SillyError.name]) do in_web_transaction(txn_name) do Transaction.notice_error(SillyError.new) end diff --git a/test/new_relic/http_client_test_cases.rb b/test/new_relic/http_client_test_cases.rb index 426666c96a..507a64e68e 100644 --- a/test/new_relic/http_client_test_cases.rb +++ b/test/new_relic/http_client_test_cases.rb @@ -285,7 +285,7 @@ def test_adds_a_request_header_to_outgoing_requests_if_xp_enabled def test_adds_a_request_header_to_outgoing_requests_if_old_xp_config_is_present NewRelic::Agent::Agent.any_instance.stubs(:connected?).returns(true) - with_config(:cross_application_tracing => true, :'distributed_tracing.enabled' => false) do + with_config(:'cross_application_tracer.enabled' => true, :'distributed_tracing.enabled' => false) do in_transaction { get_response } assert_equal "VURQV1BZRkZdXUFT", server.requests.last["HTTP_X_NEWRELIC_ID"] @@ -295,7 +295,7 @@ def test_adds_a_request_header_to_outgoing_requests_if_old_xp_config_is_present def test_adds_newrelic_transaction_header NewRelic::Agent::Agent.any_instance.stubs(:connected?).returns(true) - with_config(:cross_application_tracing => true, :'distributed_tracing.enabled' => false) do + with_config(:'cross_application_tracer.enabled' => true, :'distributed_tracing.enabled' => false) do guid = nil path_hash = nil in_transaction do |txn|