From a051d04b61c8ff0d44762986cbdd3604b9c3370a Mon Sep 17 00:00:00 2001 From: Lalleh Rafeei Date: Tue, 2 Sep 2025 16:29:41 -0700 Subject: [PATCH 01/12] Remove transaction_tracer.capture_attributes --- newrelic/config.py | 1 - tests/agent_features/test_configuration.py | 36 ++++++++++------------ 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/newrelic/config.py b/newrelic/config.py index f9c0b3578..238fce6e4 100644 --- a/newrelic/config.py +++ b/newrelic/config.py @@ -668,7 +668,6 @@ def translate_deprecated_settings(settings, cached_settings): cached = dict(cached_settings) deprecated_settings_map = [ - ("transaction_tracer.capture_attributes", "transaction_tracer.attributes.enabled"), ("error_collector.capture_attributes", "error_collector.attributes.enabled"), ("browser_monitoring.capture_attributes", "browser_monitoring.attributes.enabled"), ("analytics_events.capture_attributes", "transaction_events.attributes.enabled"), diff --git a/tests/agent_features/test_configuration.py b/tests/agent_features/test_configuration.py index 9586613bf..ef85ccb70 100644 --- a/tests/agent_features/test_configuration.py +++ b/tests/agent_features/test_configuration.py @@ -363,21 +363,27 @@ def test_strip_proxy_details(settings): assert proxy_host == expected_proxy_host -def test_delete_setting(): - d = {"transaction_tracer.capture_attributes": True} - settings = apply_server_side_settings(d) - assert "capture_attributes" in settings.transaction_tracer +# TODO: Reenable once newly deprecated settings have been +# been put into the `deprecated_settings_map` +# def test_delete_setting(): +# """This test applies to a deprecated setting +# """ +# d = {"transaction_tracer.explain_enabled": True} +# settings = apply_server_side_settings(d) +# assert "explain_enabled" in settings.transaction_tracer - delete_setting(settings, "transaction_tracer.capture_attributes") - assert "capture_attributes" not in settings.transaction_tracer +# delete_setting(settings, "transaction_tracer.explain_enabled") +# assert "explain_enabled" not in settings.transaction_tracer -def test_delete_setting_absent(): - settings = apply_server_side_settings() - assert "capture_attributes" not in settings.transaction_tracer +# def test_delete_setting_absent(): +# """This test applies to a deprecated setting +# """ +# settings = apply_server_side_settings() +# assert "explain_enabled" not in settings.transaction_tracer - delete_setting(settings, "transaction_tracer.capture_attributes") - assert "capture_attributes" not in settings.transaction_tracer +# delete_setting(settings, "transaction_tracer.explain_enabled") +# assert "explain_enabled" not in settings.transaction_tracer def test_delete_setting_parent(): @@ -407,14 +413,6 @@ def test_delete_setting_parent(): TSetting("strip_exception_messages.whitelist", ["non-default-value"], []), TSetting("strip_exception_messages.allowlist", [], []), ), - ( - TSetting("transaction_tracer.capture_attributes", True, True), - TSetting("transaction_tracer.attributes.enabled", False, True), - ), - ( - TSetting("transaction_tracer.capture_attributes", False, True), - TSetting("transaction_tracer.attributes.enabled", True, True), - ), ( TSetting("error_collector.capture_attributes", True, True), TSetting("error_collector.attributes.enabled", False, True), From 819f86cf97f3c0b13af0014616c37686a36f8a1c Mon Sep 17 00:00:00 2001 From: Lalleh Rafeei Date: Tue, 2 Sep 2025 16:34:26 -0700 Subject: [PATCH 02/12] Remove error_collector.capture_attributes --- newrelic/config.py | 1 - tests/agent_features/test_configuration.py | 8 -------- 2 files changed, 9 deletions(-) diff --git a/newrelic/config.py b/newrelic/config.py index 238fce6e4..81a72fd39 100644 --- a/newrelic/config.py +++ b/newrelic/config.py @@ -668,7 +668,6 @@ def translate_deprecated_settings(settings, cached_settings): cached = dict(cached_settings) deprecated_settings_map = [ - ("error_collector.capture_attributes", "error_collector.attributes.enabled"), ("browser_monitoring.capture_attributes", "browser_monitoring.attributes.enabled"), ("analytics_events.capture_attributes", "transaction_events.attributes.enabled"), ("analytics_events.enabled", "transaction_events.enabled"), diff --git a/tests/agent_features/test_configuration.py b/tests/agent_features/test_configuration.py index ef85ccb70..88bbc93e8 100644 --- a/tests/agent_features/test_configuration.py +++ b/tests/agent_features/test_configuration.py @@ -413,14 +413,6 @@ def test_delete_setting_parent(): TSetting("strip_exception_messages.whitelist", ["non-default-value"], []), TSetting("strip_exception_messages.allowlist", [], []), ), - ( - TSetting("error_collector.capture_attributes", True, True), - TSetting("error_collector.attributes.enabled", False, True), - ), - ( - TSetting("error_collector.capture_attributes", False, True), - TSetting("error_collector.attributes.enabled", True, True), - ), ( TSetting("browser_monitoring.capture_attributes", False, False), TSetting("browser_monitoring.attributes.enabled", True, False), From 736a622e0dd7d026d755a677b9f46a839efc4f7c Mon Sep 17 00:00:00 2001 From: Lalleh Rafeei Date: Tue, 2 Sep 2025 16:35:22 -0700 Subject: [PATCH 03/12] Remove browser_monitoring.capture_attributes --- newrelic/config.py | 1 - tests/agent_features/test_configuration.py | 8 -------- 2 files changed, 9 deletions(-) diff --git a/newrelic/config.py b/newrelic/config.py index 81a72fd39..1cd0a98b1 100644 --- a/newrelic/config.py +++ b/newrelic/config.py @@ -668,7 +668,6 @@ def translate_deprecated_settings(settings, cached_settings): cached = dict(cached_settings) deprecated_settings_map = [ - ("browser_monitoring.capture_attributes", "browser_monitoring.attributes.enabled"), ("analytics_events.capture_attributes", "transaction_events.attributes.enabled"), ("analytics_events.enabled", "transaction_events.enabled"), ("analytics_events.max_samples_stored", "event_harvest_config.harvest_limits.analytic_event_data"), diff --git a/tests/agent_features/test_configuration.py b/tests/agent_features/test_configuration.py index 88bbc93e8..8bc117346 100644 --- a/tests/agent_features/test_configuration.py +++ b/tests/agent_features/test_configuration.py @@ -413,14 +413,6 @@ def test_delete_setting_parent(): TSetting("strip_exception_messages.whitelist", ["non-default-value"], []), TSetting("strip_exception_messages.allowlist", [], []), ), - ( - TSetting("browser_monitoring.capture_attributes", False, False), - TSetting("browser_monitoring.attributes.enabled", True, False), - ), - ( - TSetting("browser_monitoring.capture_attributes", True, False), - TSetting("browser_monitoring.attributes.enabled", False, False), - ), ( TSetting("analytics_events.capture_attributes", True, True), TSetting("transaction_events.attributes.enabled", False, True), From d40b504b2fb7ac3c588e3d8a21cd8ab771c24e1e Mon Sep 17 00:00:00 2001 From: Lalleh Rafeei Date: Tue, 2 Sep 2025 16:37:44 -0700 Subject: [PATCH 04/12] Remove analytic_events.capture_attributes --- newrelic/config.py | 1 - tests/agent_features/test_configuration.py | 8 -------- 2 files changed, 9 deletions(-) diff --git a/newrelic/config.py b/newrelic/config.py index 1cd0a98b1..d9c1e2034 100644 --- a/newrelic/config.py +++ b/newrelic/config.py @@ -668,7 +668,6 @@ def translate_deprecated_settings(settings, cached_settings): cached = dict(cached_settings) deprecated_settings_map = [ - ("analytics_events.capture_attributes", "transaction_events.attributes.enabled"), ("analytics_events.enabled", "transaction_events.enabled"), ("analytics_events.max_samples_stored", "event_harvest_config.harvest_limits.analytic_event_data"), ("transaction_events.max_samples_stored", "event_harvest_config.harvest_limits.analytic_event_data"), diff --git a/tests/agent_features/test_configuration.py b/tests/agent_features/test_configuration.py index 8bc117346..34832a68f 100644 --- a/tests/agent_features/test_configuration.py +++ b/tests/agent_features/test_configuration.py @@ -413,14 +413,6 @@ def test_delete_setting_parent(): TSetting("strip_exception_messages.whitelist", ["non-default-value"], []), TSetting("strip_exception_messages.allowlist", [], []), ), - ( - TSetting("analytics_events.capture_attributes", True, True), - TSetting("transaction_events.attributes.enabled", False, True), - ), - ( - TSetting("analytics_events.capture_attributes", False, True), - TSetting("transaction_events.attributes.enabled", True, True), - ), (TSetting("analytics_events.enabled", True, True), TSetting("transaction_events.enabled", False, True)), (TSetting("analytics_events.enabled", False, True), TSetting("transaction_events.enabled", True, True)), ( From 6812d004621b81434f72607007bf09af2be936de Mon Sep 17 00:00:00 2001 From: Lalleh Rafeei Date: Tue, 2 Sep 2025 16:38:42 -0700 Subject: [PATCH 05/12] Remove analytics_events.enabled --- newrelic/config.py | 1 - tests/agent_features/test_configuration.py | 2 -- 2 files changed, 3 deletions(-) diff --git a/newrelic/config.py b/newrelic/config.py index d9c1e2034..1e723eb73 100644 --- a/newrelic/config.py +++ b/newrelic/config.py @@ -668,7 +668,6 @@ def translate_deprecated_settings(settings, cached_settings): cached = dict(cached_settings) deprecated_settings_map = [ - ("analytics_events.enabled", "transaction_events.enabled"), ("analytics_events.max_samples_stored", "event_harvest_config.harvest_limits.analytic_event_data"), ("transaction_events.max_samples_stored", "event_harvest_config.harvest_limits.analytic_event_data"), ("span_events.max_samples_stored", "event_harvest_config.harvest_limits.span_event_data"), diff --git a/tests/agent_features/test_configuration.py b/tests/agent_features/test_configuration.py index 34832a68f..b7c22ad11 100644 --- a/tests/agent_features/test_configuration.py +++ b/tests/agent_features/test_configuration.py @@ -413,8 +413,6 @@ def test_delete_setting_parent(): TSetting("strip_exception_messages.whitelist", ["non-default-value"], []), TSetting("strip_exception_messages.allowlist", [], []), ), - (TSetting("analytics_events.enabled", True, True), TSetting("transaction_events.enabled", False, True)), - (TSetting("analytics_events.enabled", False, True), TSetting("transaction_events.enabled", True, True)), ( TSetting("analytics_events.max_samples_stored", 1200, 1200), TSetting("event_harvest_config.harvest_limits.analytic_event_data", 9999, 1200), From 4a12cd9109563e300eaea04c6b642f997aee2210 Mon Sep 17 00:00:00 2001 From: Lalleh Rafeei Date: Tue, 2 Sep 2025 16:44:11 -0700 Subject: [PATCH 06/12] Remove error_collector.ignore_errors --- newrelic/config.py | 2 -- newrelic/core/config.py | 7 ------- tests/agent_features/test_configuration.py | 8 -------- 3 files changed, 17 deletions(-) diff --git a/newrelic/config.py b/newrelic/config.py index 1e723eb73..142c837e3 100644 --- a/newrelic/config.py +++ b/newrelic/config.py @@ -374,7 +374,6 @@ def _process_configuration(section): _process_setting(section, "error_collector.capture_events", "getboolean", None) _process_setting(section, "error_collector.max_event_samples_stored", "getint", None) _process_setting(section, "error_collector.capture_source", "getboolean", None) - _process_setting(section, "error_collector.ignore_errors", "get", _map_split_strings) _process_setting(section, "error_collector.ignore_classes", "get", _map_split_strings) _process_setting(section, "error_collector.ignore_status_codes", "get", _merge_ignore_status_codes) _process_setting(section, "error_collector.expected_classes", "get", _map_split_strings) @@ -674,7 +673,6 @@ def translate_deprecated_settings(settings, cached_settings): ("error_collector.max_event_samples_stored", "event_harvest_config.harvest_limits.error_event_data"), ("custom_insights_events.max_samples_stored", "event_harvest_config.harvest_limits.custom_event_data"), ("application_logging.forwarding.max_samples_stored", "event_harvest_config.harvest_limits.log_event_data"), - ("error_collector.ignore_errors", "error_collector.ignore_classes"), ("strip_exception_messages.whitelist", "strip_exception_messages.allowlist"), ] diff --git a/newrelic/core/config.py b/newrelic/core/config.py index cf7e409c2..518294630 100644 --- a/newrelic/core/config.py +++ b/newrelic/core/config.py @@ -1279,13 +1279,6 @@ def apply_server_side_settings(server_side_config=None, settings=_settings): if value == "apdex_f": agent_config["transaction_tracer.transaction_threshold"] = None - # If ignore_errors exists, and either ignore_classes is not set or it is empty - if "error_collector.ignore_errors" in agent_config and ( - "error_collector.ignore_classes" not in agent_config or not agent_config["error_collector.ignore_classes"] - ): - # Remap to newer config key - agent_config["error_collector.ignore_classes"] = agent_config.pop("error_collector.ignore_errors") - # Overlay with agent server side configuration settings. for name, value in agent_config.items(): diff --git a/tests/agent_features/test_configuration.py b/tests/agent_features/test_configuration.py index b7c22ad11..6931b9550 100644 --- a/tests/agent_features/test_configuration.py +++ b/tests/agent_features/test_configuration.py @@ -461,14 +461,6 @@ def test_delete_setting_parent(): TSetting("application_logging.forwarding.max_samples_stored", 99999, 10000), TSetting("event_harvest_config.harvest_limits.log_event_data", 10000, 10000), ), - ( - TSetting("error_collector.ignore_errors", [], []), - TSetting("error_collector.ignore_classes", callable_name(ValueError), []), - ), - ( - TSetting("error_collector.ignore_errors", callable_name(ValueError), []), - TSetting("error_collector.ignore_classes", [], []), - ), ] From 89837763659dfb9c9381cdafb96e3a77a264de11 Mon Sep 17 00:00:00 2001 From: Lalleh Rafeei Date: Tue, 2 Sep 2025 16:45:27 -0700 Subject: [PATCH 07/12] Remove strip_exception_messages.whitelist --- newrelic/config.py | 1 - tests/agent_features/test_configuration.py | 8 -------- 2 files changed, 9 deletions(-) diff --git a/newrelic/config.py b/newrelic/config.py index 142c837e3..413ba63d8 100644 --- a/newrelic/config.py +++ b/newrelic/config.py @@ -673,7 +673,6 @@ def translate_deprecated_settings(settings, cached_settings): ("error_collector.max_event_samples_stored", "event_harvest_config.harvest_limits.error_event_data"), ("custom_insights_events.max_samples_stored", "event_harvest_config.harvest_limits.custom_event_data"), ("application_logging.forwarding.max_samples_stored", "event_harvest_config.harvest_limits.log_event_data"), - ("strip_exception_messages.whitelist", "strip_exception_messages.allowlist"), ] for old_key, new_key in deprecated_settings_map: diff --git a/tests/agent_features/test_configuration.py b/tests/agent_features/test_configuration.py index 6931b9550..8dc8a3c5f 100644 --- a/tests/agent_features/test_configuration.py +++ b/tests/agent_features/test_configuration.py @@ -405,14 +405,6 @@ def test_delete_setting_parent(): TSetting = collections.namedtuple("TSetting", ["name", "value", "default"]) translate_settings_tests = [ - ( - TSetting("strip_exception_messages.whitelist", [], []), - TSetting("strip_exception_messages.allowlist", ["non-default-value"], []), - ), - ( - TSetting("strip_exception_messages.whitelist", ["non-default-value"], []), - TSetting("strip_exception_messages.allowlist", [], []), - ), ( TSetting("analytics_events.max_samples_stored", 1200, 1200), TSetting("event_harvest_config.harvest_limits.analytic_event_data", 9999, 1200), From 28f8e544e756f8668ffe8220794d64604d738144 Mon Sep 17 00:00:00 2001 From: Lalleh Rafeei Date: Tue, 2 Sep 2025 16:59:54 -0700 Subject: [PATCH 08/12] Remove ssl as a setting --- newrelic/config.py | 5 ----- newrelic/core/config.py | 2 -- 2 files changed, 7 deletions(-) diff --git a/newrelic/config.py b/newrelic/config.py index 413ba63d8..55fcc1cfc 100644 --- a/newrelic/config.py +++ b/newrelic/config.py @@ -331,7 +331,6 @@ def _process_configuration(section): _process_setting(section, "port", "getint", None) _process_setting(section, "otlp_host", "get", None) _process_setting(section, "otlp_port", "getint", None) - _process_setting(section, "ssl", "getboolean", None) _process_setting(section, "proxy_scheme", "get", None) _process_setting(section, "proxy_host", "get", None) _process_setting(section, "proxy_port", "getint", None) @@ -746,10 +745,6 @@ def translate_deprecated_settings(settings, cached_settings): "https://docs.newrelic.com/docs/distributed-tracing/concepts/distributed-tracing-planning-guide/#changes." ) - if not settings.ssl: - settings.ssl = True - _logger.info("Ignoring deprecated setting: ssl. Enabling ssl is now mandatory. Setting ssl=true.") - if settings.agent_limits.merge_stats_maximum is not None: _logger.info( "Ignoring deprecated setting: " diff --git a/newrelic/core/config.py b/newrelic/core/config.py index 518294630..1623d741e 100644 --- a/newrelic/core/config.py +++ b/newrelic/core/config.py @@ -711,8 +711,6 @@ def default_otlp_host(host): _settings.license_key = os.environ.get("NEW_RELIC_LICENSE_KEY", None) _settings.api_key = os.environ.get("NEW_RELIC_API_KEY", None) -_settings.ssl = _environ_as_bool("NEW_RELIC_SSL", True) - _settings.host = os.environ.get("NEW_RELIC_HOST") _settings.otlp_host = os.environ.get("NEW_RELIC_OTLP_HOST") _settings.port = int(os.environ.get("NEW_RELIC_PORT", "0")) From 16abfecd18f85f0e5f1810ca69aad7447568e857 Mon Sep 17 00:00:00 2001 From: Lalleh Rafeei Date: Wed, 3 Sep 2025 10:40:47 -0700 Subject: [PATCH 09/12] Remove agent_limits.merge_stats_maximum setting --- newrelic/config.py | 8 -------- newrelic/core/config.py | 1 - tests/agent_unittests/test_harvest_loop.py | 16 ---------------- 3 files changed, 25 deletions(-) diff --git a/newrelic/config.py b/newrelic/config.py index 55fcc1cfc..355f0f782 100644 --- a/newrelic/config.py +++ b/newrelic/config.py @@ -419,7 +419,6 @@ def _process_configuration(section): _process_setting(section, "agent_limits.sql_explain_plans", "getint", None) _process_setting(section, "agent_limits.sql_explain_plans_per_harvest", "getint", None) _process_setting(section, "agent_limits.slow_sql_data", "getint", None) - _process_setting(section, "agent_limits.merge_stats_maximum", "getint", None) _process_setting(section, "agent_limits.errors_per_transaction", "getint", None) _process_setting(section, "agent_limits.errors_per_harvest", "getint", None) _process_setting(section, "agent_limits.slow_transaction_dry_harvests", "getint", None) @@ -745,13 +744,6 @@ def translate_deprecated_settings(settings, cached_settings): "https://docs.newrelic.com/docs/distributed-tracing/concepts/distributed-tracing-planning-guide/#changes." ) - if settings.agent_limits.merge_stats_maximum is not None: - _logger.info( - "Ignoring deprecated setting: " - "agent_limits.merge_stats_maximum. The agent will now respect " - "server-side commands." - ) - return settings diff --git a/newrelic/core/config.py b/newrelic/core/config.py index 1623d741e..e1805b1cf 100644 --- a/newrelic/core/config.py +++ b/newrelic/core/config.py @@ -887,7 +887,6 @@ def default_otlp_host(host): _settings.agent_limits.sql_explain_plans = 30 _settings.agent_limits.sql_explain_plans_per_harvest = 60 _settings.agent_limits.slow_sql_data = 10 -_settings.agent_limits.merge_stats_maximum = None _settings.agent_limits.errors_per_transaction = 5 _settings.agent_limits.errors_per_harvest = 20 _settings.agent_limits.slow_transaction_dry_harvests = 5 diff --git a/tests/agent_unittests/test_harvest_loop.py b/tests/agent_unittests/test_harvest_loop.py index 0439ba165..7a5e43be3 100644 --- a/tests/agent_unittests/test_harvest_loop.py +++ b/tests/agent_unittests/test_harvest_loop.py @@ -858,22 +858,6 @@ def test_default_events_harvested(allowlist_event): assert app._stats_engine.metrics_count() == 4 -@failing_endpoint("analytic_event_data") -@override_generic_settings(settings, {"developer_mode": True, "agent_limits.merge_stats_maximum": 0}) -def test_infinite_merges(): - app = Application("Python Agent Test (Harvest Loop)") - app.connect_to_data_collector(None) - - app._stats_engine.transaction_events.add("transaction event") - - assert app._stats_engine.transaction_events.num_seen == 1 - - app.harvest() - - # the agent_limits.merge_stats_maximum is not respected - assert app._stats_engine.transaction_events.num_seen == 1 - - @failing_endpoint("analytic_event_data") @override_generic_settings(settings, {"developer_mode": True}) def test_flexible_harvest_rollback(): From 9bbfa3f49b0bcee6b2d4c30d004a195f2eacab83 Mon Sep 17 00:00:00 2001 From: Lalleh Rafeei Date: Wed, 3 Sep 2025 11:10:46 -0700 Subject: [PATCH 10/12] Remove ignore_params setting --- newrelic/config.py | 35 ------------------- newrelic/core/config.py | 1 - tests/agent_features/test_configuration.py | 40 ---------------------- 3 files changed, 76 deletions(-) diff --git a/newrelic/config.py b/newrelic/config.py index 355f0f782..f40cc5d7a 100644 --- a/newrelic/config.py +++ b/newrelic/config.py @@ -342,7 +342,6 @@ def _process_configuration(section): _process_setting(section, "developer_mode", "getboolean", None) _process_setting(section, "high_security", "getboolean", None) _process_setting(section, "capture_params", "getboolean", None) - _process_setting(section, "ignored_params", "get", _map_split_strings) _process_setting(section, "capture_environ", "getboolean", None) _process_setting(section, "include_environ", "get", _map_split_strings) _process_setting(section, "max_stack_trace_lines", "getint", None) @@ -685,40 +684,6 @@ def translate_deprecated_settings(settings, cached_settings): delete_setting(settings, old_key) - # The 'ignored_params' setting is more complicated than the above - # deprecated settings, so it gets handled separately. - - if "ignored_params" in cached: - _logger.info( - "Deprecated setting found: ignored_params. Please use " - "new setting: attributes.exclude. For the new setting, an " - "ignored parameter should be prefaced with " - '"request.parameters.". For example, ignoring a parameter ' - 'named "foo" should be added added to attributes.exclude as ' - '"request.parameters.foo."' - ) - - # Don't merge 'ignored_params' settings. If user set - # 'attributes.exclude' setting, only use those values, - # and ignore 'ignored_params' settings. - - if "attributes.exclude" in cached: - _logger.info("Ignoring deprecated setting: ignored_params. Using new setting: attributes.exclude.") - - else: - ignored_params = fetch_config_setting(settings, "ignored_params") - - for p in ignored_params: - attr_value = f"request.parameters.{p}" - excluded_attrs = fetch_config_setting(settings, "attributes.exclude") - - if attr_value not in excluded_attrs: - settings.attributes.exclude.append(attr_value) - _logger.info( - "Applying value of deprecated setting ignored_params to attributes.exclude: %r.", attr_value - ) - - delete_setting(settings, "ignored_params") # The 'capture_params' setting is deprecated, but since it affects # attribute filter default destinations, it is not translated here. We diff --git a/newrelic/core/config.py b/newrelic/core/config.py index e1805b1cf..f1b71842c 100644 --- a/newrelic/core/config.py +++ b/newrelic/core/config.py @@ -754,7 +754,6 @@ def default_otlp_host(host): _settings.web_transactions_apdex = {} _settings.capture_params = None -_settings.ignored_params = [] _settings.capture_environ = True _settings.include_environ = [ diff --git a/tests/agent_features/test_configuration.py b/tests/agent_features/test_configuration.py index 8dc8a3c5f..8c15813c7 100644 --- a/tests/agent_features/test_configuration.py +++ b/tests/agent_features/test_configuration.py @@ -523,46 +523,6 @@ def test_translate_deprecated_setting_without_old_setting(old, new): assert fetch_config_setting(result, new.name) == new.value -def test_translate_deprecated_ignored_params_without_new_setting(): - ignored_params = ["foo", "bar"] - settings = apply_server_side_settings() - apply_config_setting(settings, "ignored_params", ignored_params) - - assert "foo" in settings.ignored_params - assert "bar" in settings.ignored_params - assert len(settings.attributes.exclude) == 0 - - cached = [("ignored_params", ignored_params)] - result = translate_deprecated_settings(settings, cached) - - assert result is settings - assert "request.parameters.foo" in result.attributes.exclude - assert "request.parameters.bar" in result.attributes.exclude - assert "ignored_params" not in result - - -def test_translate_deprecated_ignored_params_with_new_setting(): - ignored_params = ["foo", "bar"] - attr_exclude = ["request.parameters.foo"] - settings = apply_server_side_settings() - apply_config_setting(settings, "ignored_params", ignored_params) - apply_config_setting(settings, "attributes.exclude", attr_exclude) - - assert "foo" in settings.ignored_params - assert "bar" in settings.ignored_params - assert "request.parameters.foo" in settings.attributes.exclude - - cached = [("ignored_params", ignored_params), ("attributes.exclude", attr_exclude)] - result = translate_deprecated_settings(settings, cached) - - # ignored_params are not merged! - - assert result is settings - assert "request.parameters.foo" in result.attributes.exclude - assert "request.parameters.bar" not in result.attributes.exclude - assert "ignored_params" not in result - - @pytest.mark.parametrize( "name,expected_value", ( From 122d43b11b073a971d76e0b4410aafccc13342dc Mon Sep 17 00:00:00 2001 From: Lalleh Rafeei Date: Thu, 4 Sep 2025 17:22:24 -0700 Subject: [PATCH 11/12] ignore_errors removed from test --- tests/agent_features/test_configuration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/agent_features/test_configuration.py b/tests/agent_features/test_configuration.py index 8c15813c7..449722e57 100644 --- a/tests/agent_features/test_configuration.py +++ b/tests/agent_features/test_configuration.py @@ -918,7 +918,7 @@ def test_map_aws_account_id(account_id, expected_account_id, logger): [tool.newrelic.error_collector] enabled = true -ignore_errors = ["module:name1", "module:name"] +ignore_classes = ["module:name1", "module:name"] [tool.newrelic.transaction_tracer] enabled = true From 946fa2713b48058aba1bf13f8e15e5c775ab0a26 Mon Sep 17 00:00:00 2001 From: Lalleh Rafeei Date: Fri, 5 Sep 2025 16:04:50 -0700 Subject: [PATCH 12/12] Fix megalinter errors --- newrelic/config.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/newrelic/config.py b/newrelic/config.py index f40cc5d7a..7cef74e7c 100644 --- a/newrelic/config.py +++ b/newrelic/config.py @@ -48,7 +48,7 @@ agent_control_health_instance, agent_control_healthcheck_loop, ) -from newrelic.core.config import Settings, apply_config_setting, default_host, fetch_config_setting +from newrelic.core.config import Settings, apply_config_setting, default_host __all__ = ["filter_app_factory", "initialize"] @@ -684,7 +684,6 @@ def translate_deprecated_settings(settings, cached_settings): delete_setting(settings, old_key) - # The 'capture_params' setting is deprecated, but since it affects # attribute filter default destinations, it is not translated here. We # log a message, but keep the capture_params setting.