From 0d5dcd40cea91fb0c9ebc061c1804fac448e4a62 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Wed, 1 Feb 2023 09:12:41 -0800 Subject: [PATCH 01/28] set apdex_t config to non public. It was deprecated, but the agent still uses it for the server side value but it can no longer be set by users through newrelic.ym or anything --- lib/new_relic/agent/configuration/default_source.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index 182af4fd4d..9d25d5febe 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -370,12 +370,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 => { From 68ed1112489ec17c981674c73c783dc76b1b7530 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Wed, 1 Feb 2023 09:35:08 -0800 Subject: [PATCH 02/28] removed deprecated *.capture_attribute configs and updated tests accordingly --- .../agent/configuration/default_source.rb | 45 ++----------------- .../configuration/default_source_test.rb | 23 ---------- .../agent/javascript_instrumentor_test.rb | 11 +++-- .../agent/transaction_event_primitive_test.rb | 20 --------- 4 files changed, 9 insertions(+), 90 deletions(-) diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index 9d25d5febe..4ac7f770a9 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -566,14 +566,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,14 +631,6 @@ 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 => [], :public => true, @@ -773,23 +757,6 @@ 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, @@ -885,8 +852,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 +875,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 +921,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 +967,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, diff --git a/test/new_relic/agent/configuration/default_source_test.rb b/test/new_relic/agent/configuration/default_source_test.rb index 5c8e5c5ed3..0c329ab732 100644 --- a/test/new_relic/agent/configuration/default_source_test.rb +++ b/test/new_relic/agent/configuration/default_source_test.rb @@ -139,29 +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 diff --git a/test/new_relic/agent/javascript_instrumentor_test.rb b/test/new_relic/agent/javascript_instrumentor_test.rb index b22d822c44..4135436f37 100644 --- a/test/new_relic/agent/javascript_instrumentor_test.rb +++ b/test/new_relic/agent/javascript_instrumentor_test.rb @@ -158,7 +158,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 +190,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 +238,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 +250,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 +258,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 +278,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/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) From 99bd9b14986762db9629b47630c727c363dc406c Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Wed, 1 Feb 2023 13:08:09 -0800 Subject: [PATCH 03/28] removed ignore_errors and updated tests --- .../agent/configuration/default_source.rb | 14 -------------- lib/new_relic/agent/error_filter.rb | 6 +++--- test/new_relic/agent/error_collector_test.rb | 14 ++------------ test/new_relic/agent/error_filter_test.rb | 10 ---------- test/new_relic/agent/transaction_test.rb | 2 +- 5 files changed, 6 insertions(+), 40 deletions(-) diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index 4ac7f770a9..3df71d2956 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -697,21 +697,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, 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/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/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 From dc342090ee84863ad4c42998d609c7c72890a5b5 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Wed, 1 Feb 2023 13:59:39 -0800 Subject: [PATCH 04/28] rubocop mad --- test/new_relic/agent/configuration/default_source_test.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/test/new_relic/agent/configuration/default_source_test.rb b/test/new_relic/agent/configuration/default_source_test.rb index 0c329ab732..009ef7b0c4 100644 --- a/test/new_relic/agent/configuration/default_source_test.rb +++ b/test/new_relic/agent/configuration/default_source_test.rb @@ -139,7 +139,6 @@ def test_config_search_path_in_warbler end end - def test_application_logging_enabled_default with_config(:'application_logging.enabled' => :foo) do assert_equal :foo, NewRelic::Agent.config['application_logging.enabled'] From b8a37535d8f312e003aaecf462da318cebb1cab0 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Wed, 1 Feb 2023 14:54:52 -0800 Subject: [PATCH 05/28] add rails and sinatra errors to default ignore --- lib/new_relic/agent/configuration/default_source.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index 3df71d2956..bd24b8b424 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -632,7 +632,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) }, # Error collector :'error_collector.ignore_classes' => { - :default => [], + :default => ['ActionController::RoutingError', 'Sinatra::NotFound'], :public => true, :type => Array, :allowed_from_server => true, @@ -761,7 +761,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) }, # Transaction events :'transaction_events.enabled' => { - :default => value_of(:'analytics_events.enabled'), + :default => true, :documentation_default => true, :public => true, :type => Boolean, From 09cba987d7310171d6fae6b9950c6b2bc85a4c9f Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Wed, 1 Feb 2023 14:57:21 -0800 Subject: [PATCH 06/28] put back for test --- lib/new_relic/agent/configuration/default_source.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index bd24b8b424..3ade79e285 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -761,7 +761,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) }, # Transaction events :'transaction_events.enabled' => { - :default => true, + :default => instrumentation_value_of(:'analytics_events.enabled'), :documentation_default => true, :public => true, :type => Boolean, From f0a0a0ae0cd83ea86e962198103b35bf6b4716fc Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 2 Feb 2023 14:22:43 -0800 Subject: [PATCH 07/28] fix rails tests --- .../agent/configuration/default_source.rb | 4 ++-- lib/new_relic/agent/error_collector.rb | 2 +- test/multiverse/suites/rails/config/newrelic.yml | 2 +- test/multiverse/suites/rails/error_tracing_test.rb | 14 +------------- 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index 3ade79e285..1764f96cb0 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -632,7 +632,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) }, # Error collector :'error_collector.ignore_classes' => { - :default => ['ActionController::RoutingError', 'Sinatra::NotFound'], + :default => [],#['ActionController::RoutingError', 'Sinatra::NotFound'], :public => true, :type => Array, :allowed_from_server => true, @@ -761,7 +761,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) }, # Transaction events :'transaction_events.enabled' => { - :default => instrumentation_value_of(:'analytics_events.enabled'), + :default => value_of(:'analytics_events.enabled'), :documentation_default => true, :public => true, :type => Boolean, 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/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..b749169bde 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'], # 'ActionController::RoutingError', 'Sinatra::NotFound'], "error_collector.enabled" => true }, "collect_errors" => true From f6fb55dae8fd328e3a3f4389c19cd53cbb34dcd9 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 2 Feb 2023 14:42:15 -0800 Subject: [PATCH 08/28] rubocop mad --- lib/new_relic/agent/configuration/default_source.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index 1764f96cb0..070dc9c6a0 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -632,7 +632,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) }, # Error collector :'error_collector.ignore_classes' => { - :default => [],#['ActionController::RoutingError', 'Sinatra::NotFound'], + :default => [], # ['ActionController::RoutingError', 'Sinatra::NotFound'], :public => true, :type => Array, :allowed_from_server => true, From 30904359501c17c487c4cb532caccf46a06fea2b Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 2 Feb 2023 15:00:09 -0800 Subject: [PATCH 09/28] removed analytic_event configs --- .../agent/configuration/default_source.rb | 34 ++----------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index 070dc9c6a0..2a296bbdae 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -743,34 +743,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).' }, - :'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, @@ -1154,15 +1136,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, @@ -1541,8 +1514,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, From 89b1744e9689b4e096d3a8c90847b5749dab8ae9 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 2 Feb 2023 15:09:01 -0800 Subject: [PATCH 10/28] fix transaction_events related tests --- test/new_relic/agent/agent/connect_test.rb | 2 +- .../trace_context_cross_agent_test.rb | 2 +- test/new_relic/agent/transaction/trace_context_test.rb | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) 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/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/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 From 5228552c8cfe7890d9a23353f1f4fce8a6c36870 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 2 Feb 2023 15:10:25 -0800 Subject: [PATCH 11/28] put default ignored error classes back --- lib/new_relic/agent/configuration/default_source.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index 2a296bbdae..edee4fd41e 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -632,7 +632,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) }, # Error collector :'error_collector.ignore_classes' => { - :default => [], # ['ActionController::RoutingError', 'Sinatra::NotFound'], + :default => ['ActionController::RoutingError', 'Sinatra::NotFound'], :public => true, :type => Array, :allowed_from_server => true, From c29fbba2620eb286df539776159e9308b08853b7 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 2 Feb 2023 15:25:34 -0800 Subject: [PATCH 12/28] removed several instrumentation configs --- .../agent/configuration/default_source.rb | 243 ++---------------- 1 file changed, 19 insertions(+), 224 deletions(-) diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index edee4fd41e..a93b4641f6 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -1144,23 +1144,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_data_mapper => { :default => false, :public => true, @@ -1168,24 +1151,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :allowed_from_server => false, :description => 'If `true`, disables DataMapper instrumentation.' }, - :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, @@ -1194,49 +1159,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, @@ -1244,42 +1166,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, @@ -1295,78 +1181,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, @@ -1388,14 +1202,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, @@ -1420,15 +1226,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, @@ -1530,7 +1327,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, @@ -1539,7 +1336,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, @@ -1556,7 +1353,7 @@ 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, :type => String, @@ -1565,8 +1362,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :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', + :default => 'auto', :public => :true, :type => String, :dynamic_name => true, @@ -1600,7 +1396,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, @@ -1609,7 +1405,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, @@ -1627,8 +1423,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, @@ -1636,7 +1431,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, @@ -1654,7 +1449,7 @@ 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, :type => String, @@ -1663,7 +1458,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :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, @@ -1672,7 +1467,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, @@ -1683,7 +1478,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, @@ -1692,7 +1487,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, @@ -1703,7 +1498,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, @@ -1712,7 +1507,7 @@ 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), + :default => 'auto', :documentation_default => 'auto', :public => :true, :type => String, @@ -1721,7 +1516,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :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), + :default => 'auto', :documentation_default => 'auto', :public => true, :type => String, @@ -1730,7 +1525,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, @@ -1739,7 +1534,7 @@ 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), + :default => 'auto', :documentation_default => 'auto', :public => :true, :type => String, @@ -1778,7 +1573,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, From 31f62cfcfeb57b4651afa580124b241776935c7e Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 2 Feb 2023 15:41:23 -0800 Subject: [PATCH 13/28] remove references to now deleted configs --- lib/new_relic/agent/instrumentation/memcache.rb | 4 ++-- lib/new_relic/agent/instrumentation/resque.rb | 2 +- lib/new_relic/agent/instrumentation/sequel.rb | 3 +-- lib/new_relic/agent/samplers/delayed_job_sampler.rb | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) 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/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/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 From 07bfb62f1152d01982236eb2e589b681bcd96b8b Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 2 Feb 2023 15:42:40 -0800 Subject: [PATCH 14/28] remove test for deleted config --- test/new_relic/agent/configuration/manager_test.rb | 8 -------- 1 file changed, 8 deletions(-) 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') From 9f98858c8f817ecb131e24261401b0f5689f7131 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 2 Feb 2023 15:49:01 -0800 Subject: [PATCH 15/28] remove deprecated configs and fix grape name --- .../agent/configuration/default_source.rb | 49 +++---------------- lib/new_relic/agent/instrumentation/grape.rb | 2 +- 2 files changed, 7 insertions(+), 44 deletions(-) diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index a93b4641f6..0f40011c36 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -1355,7 +1355,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :'instrumentation.excon' => { :default => 'enabled', :documentation_default => 'enabled', - :public => :true, + :public => true, :type => String, :dynamic_name => true, :allowed_from_server => false, @@ -1363,7 +1363,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) }, :'instrumentation.grape' => { :default => 'auto', - :public => :true, + :public => true, :type => String, :dynamic_name => true, :allowed_from_server => false, @@ -1451,7 +1451,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :'instrumentation.mongo' => { :default => 'enabled', :documentation_default => 'enabled', - :public => :true, + :public => true, :type => String, :dynamic_name => true, :allowed_from_server => false, @@ -1508,8 +1508,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) }, :'instrumentation.rake' => { :default => 'auto', - :documentation_default => 'auto', - :public => :true, + :public => true, :type => String, :dynamic_name => true, :allowed_from_server => false, @@ -1517,7 +1516,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) }, :'instrumentation.redis' => { :default => 'auto', - :documentation_default => 'auto', :public => true, :type => String, :dynamic_name => true, @@ -1535,8 +1533,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) }, :'instrumentation.sinatra' => { :default => 'auto', - :documentation_default => 'auto', - :public => :true, + :public => true, :type => String, :dynamic_name => true, :allowed_from_server => false, @@ -1915,15 +1912,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, @@ -1945,22 +1933,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, @@ -2007,17 +1979,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, 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 From c4af2a86b8028f399689075d1f795a90624bf152 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 2 Feb 2023 15:50:45 -0800 Subject: [PATCH 16/28] update instrumentation nameing --- lib/new_relic/agent/instrumentation/rake.rb | 2 +- lib/new_relic/agent/instrumentation/redis.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 From 64fbf76eec7da03bfdc5fe9d1c4983497be90342 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 2 Feb 2023 15:53:19 -0800 Subject: [PATCH 17/28] remove decprecated net http prepend config --- lib/new_relic/agent/configuration/default_source.rb | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index 0f40011c36..94ac42d0f0 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -2116,15 +2116,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, From f5d6b6ba090b0cdc89ffb4fb84cdce198dc320fe Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 2 Feb 2023 16:01:29 -0800 Subject: [PATCH 18/28] update rails test using analytic_events config --- test/multiverse/suites/rails/request_statistics_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) From b012ff9359e7c7f108c7bb99eccbc953e883488a Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 2 Feb 2023 16:04:09 -0800 Subject: [PATCH 19/28] update rake test using deprecated config --- test/multiverse/suites/rake/rake_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From c60ca5ababa19f039def3884d9b9fd1c683df96f Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 2 Feb 2023 16:35:19 -0800 Subject: [PATCH 20/28] remove keep_trying config --- lib/new_relic/agent/agent_helpers/connect.rb | 2 +- lib/new_relic/agent/configuration/default_source.rb | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) 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/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index 94ac42d0f0..f01a567d8e 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -2087,14 +2087,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, From 658762aa09133afa62e5d6b803dbab82dd2dbc1b Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Fri, 3 Feb 2023 10:02:28 -0800 Subject: [PATCH 21/28] removed deprecated jobs capture_params configs --- lib/new_relic/agent/attribute_filter.rb | 2 -- .../agent/configuration/default_source.rb | 20 ------------- .../configuration/high_security_source.rb | 2 -- .../configuration/security_policy_source.rb | 16 ----------- .../security_policy_settings.rb | 1 - .../suites/resque/instrumentation_test.rb | 2 +- .../sidekiq/sidekiq_instrumentation_test.rb | 2 +- test/new_relic/agent/attribute_filter_test.rb | 28 +++++++++++++++---- .../security_policy_source_test.rb | 23 --------------- .../security_policy_settings_test.rb | 2 -- 10 files changed, 24 insertions(+), 74 deletions(-) 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 e5bb9deba3..af3faf4fe3 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -1639,16 +1639,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 => [], @@ -1658,16 +1648,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'), 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/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/test/multiverse/suites/resque/instrumentation_test.rb b/test/multiverse/suites/resque/instrumentation_test.rb index fca8131ff0..466659beec 100644 --- a/test/multiverse/suites/resque/instrumentation_test.rb +++ b/test/multiverse/suites/resque/instrumentation_test.rb @@ -98,7 +98,7 @@ def test_isnt_influenced_by_global_capture_params def test_agent_posts_captured_args_to_job stub_for_span_collection - with_config(:'resque.capture_params' => true) do + with_config(:'attributes.include' => ['job.resque.args.*']) do run_jobs end diff --git a/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb b/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb index bab31f0a45..dbf5e8ca15 100644 --- a/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb +++ b/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb @@ -155,7 +155,7 @@ def test_isnt_influenced_by_global_capture_params def test_agent_posts_captured_args_to_job stub_for_span_collection - with_config(:'sidekiq.capture_params' => true) do + with_config(:'attributes.include' => 'job.sidekiq.args.*') do run_jobs end 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/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/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}, From fe38b65fa3c7e5186096fa4a19a292c0bcd8b904 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Fri, 3 Feb 2023 10:17:03 -0800 Subject: [PATCH 22/28] remove resque test for deleted config --- .../suites/resque/instrumentation_test.rb | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/test/multiverse/suites/resque/instrumentation_test.rb b/test/multiverse/suites/resque/instrumentation_test.rb index 466659beec..34b5baae98 100644 --- a/test/multiverse/suites/resque/instrumentation_test.rb +++ b/test/multiverse/suites/resque/instrumentation_test.rb @@ -95,24 +95,14 @@ 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(:'attributes.include' => ['job.resque.args.*']) 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 - + with_config(:'attributes.include' => 'job.resque.args.*') do run_jobs end - + + assert_attributes_on_transaction_traces assert_attributes_on_events end From 405c81e77ce2a6bf171e6c28c7570fd6eaebe04c Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Fri, 3 Feb 2023 10:17:30 -0800 Subject: [PATCH 23/28] rubocop --- test/multiverse/suites/resque/instrumentation_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/multiverse/suites/resque/instrumentation_test.rb b/test/multiverse/suites/resque/instrumentation_test.rb index 34b5baae98..ebc9856270 100644 --- a/test/multiverse/suites/resque/instrumentation_test.rb +++ b/test/multiverse/suites/resque/instrumentation_test.rb @@ -97,11 +97,11 @@ def test_isnt_influenced_by_global_capture_params def test_arguments_are_captured_on_transaction_and_span_events_when_enabled stub_for_span_collection - + with_config(:'attributes.include' => 'job.resque.args.*') do run_jobs end - + assert_attributes_on_transaction_traces assert_attributes_on_events end From 1f74d80006a15c3bb7d7dbaf01893e1de0a9c0f4 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Fri, 3 Feb 2023 10:29:30 -0800 Subject: [PATCH 24/28] delete commented out code --- test/multiverse/suites/rails/error_tracing_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/multiverse/suites/rails/error_tracing_test.rb b/test/multiverse/suites/rails/error_tracing_test.rb index b749169bde..3a866b2d11 100644 --- a/test/multiverse/suites/rails/error_tracing_test.rb +++ b/test/multiverse/suites/rails/error_tracing_test.rb @@ -354,7 +354,7 @@ def setup_collector_mocks $collector.stub('connect', { "agent_run_id" => 1, "agent_config" => { - "error_collector.ignore_classes" => ['NewRelic::TestHelpers::Exceptions::IgnoredError', 'NewRelic::TestHelpers::Exceptions::ServerIgnoredError'], # 'ActionController::RoutingError', 'Sinatra::NotFound'], + "error_collector.ignore_classes" => ['NewRelic::TestHelpers::Exceptions::IgnoredError', 'NewRelic::TestHelpers::Exceptions::ServerIgnoredError'], "error_collector.enabled" => true }, "collect_errors" => true From cd7a9312ebd77227fe079e430fd4d63cd0ed8be3 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Fri, 3 Feb 2023 10:32:09 -0800 Subject: [PATCH 25/28] update sidekiq param tests --- .../suites/sidekiq/sidekiq_instrumentation_test.rb | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb b/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb index dbf5e8ca15..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(:'attributes.include' => 'job.sidekiq.args.*') 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 From 5e50412ae4c5a37cfc91b6d02c12f7ba2db646a4 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Fri, 3 Feb 2023 10:46:39 -0800 Subject: [PATCH 26/28] delete js_errors_beta config --- .../agent/configuration/default_source.rb | 17 +---------------- lib/new_relic/agent/javascript_instrumentor.rb | 1 + .../agent/javascript_instrumentor_test.rb | 14 +------------- 3 files changed, 3 insertions(+), 29 deletions(-) diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index af3faf4fe3..32cc97a1b9 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 @@ -1836,7 +1829,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, @@ -2052,14 +2045,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, diff --git a/lib/new_relic/agent/javascript_instrumentor.rb b/lib/new_relic/agent/javascript_instrumentor.rb index 1eeea85f78..4ab1424fa2 100644 --- a/lib/new_relic/agent/javascript_instrumentor.rb +++ b/lib/new_relic/agent/javascript_instrumentor.rb @@ -18,6 +18,7 @@ def initialize(event_listener) end def log_configuration + NewRelic::Agent.logger.debug("JS agent loader requested: #{NewRelic::Agent.config[:'browser_monitoring.loader']}", "JS agent loader debug: #{NewRelic::Agent.config[:'browser_monitoring.debug']}", "JS agent loader version: #{NewRelic::Agent.config[:'browser_monitoring.loader_version']}") diff --git a/test/new_relic/agent/javascript_instrumentor_test.rb b/test/new_relic/agent/javascript_instrumentor_test.rb index 4135436f37..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 From 1c58bc1f85c7e2a0e7e498cfff61e3e2aa59ba35 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Fri, 3 Feb 2023 10:51:37 -0800 Subject: [PATCH 27/28] remvoe whitespace --- lib/new_relic/agent/javascript_instrumentor.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/new_relic/agent/javascript_instrumentor.rb b/lib/new_relic/agent/javascript_instrumentor.rb index 4ab1424fa2..1eeea85f78 100644 --- a/lib/new_relic/agent/javascript_instrumentor.rb +++ b/lib/new_relic/agent/javascript_instrumentor.rb @@ -18,7 +18,6 @@ def initialize(event_listener) end def log_configuration - NewRelic::Agent.logger.debug("JS agent loader requested: #{NewRelic::Agent.config[:'browser_monitoring.loader']}", "JS agent loader debug: #{NewRelic::Agent.config[:'browser_monitoring.debug']}", "JS agent loader version: #{NewRelic::Agent.config[:'browser_monitoring.loader_version']}") From 37f9cfedc0bc012ab10d7296d2503af1a8bd4bdf Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Fri, 3 Feb 2023 10:59:22 -0800 Subject: [PATCH 28/28] removed one of the CAT configs --- lib/new_relic/agent/configuration/default_source.rb | 9 --------- .../agent/distributed_tracing/cross_app_tracing.rb | 3 +-- test/new_relic/agent/monitors/cross_app_monitor_test.rb | 2 +- test/new_relic/http_client_test_cases.rb | 4 ++-- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index 32cc97a1b9..56fe048b76 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -1906,15 +1906,6 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :allowed_from_server => false, :description => 'Internal name for controlling Rails 3+ middleware instrumentation' }, - :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, 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/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/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|