Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all previously deprecated configuration options #1782

Merged
merged 30 commits into from
Feb 3, 2023

Conversation

tannalynn
Copy link
Contributor

@tannalynn tannalynn commented Feb 1, 2023

Removes all deprecated config options except cross_application_tracing.enabled, as CAT is still deprecated but not being removed yet.

I had to update several tests to use the new configs, and also deleted a bunch of tests that were testing to make sure the deprecated (and now removed) configs were still working.

all ci run
closes ##957

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
:apdex_t => {
:default => 0.5,
:public => true,
:public => false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it turns out this config is only deprecated for use in the newrelic.yml and env variables. This should only be set via server side config.
The agent however, still uses this value for things so we need to keep the config. So I've removed the deprecated tag and instead have made this a non public config option.

@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these tests were all using the old config. Other tests in this file were already using the new config as ATTRIBUTES_ENABLED, so these tests were just updated to use that now

@tannalynn tannalynn closed this Feb 2, 2023
@tannalynn tannalynn reopened this Feb 2, 2023
@tannalynn tannalynn closed this Feb 2, 2023
@tannalynn tannalynn reopened this Feb 2, 2023
@@ -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)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These attributes are no longer treated special and separate, they now work exactly like any other attribute given to the attribute.include config.

@@ -11,8 +11,6 @@ class HighSecuritySource < DottedHash
def initialize(local_settings)
super({
:capture_params => false,
:'resque.capture_params' => false,
:'sidekiq.capture_params' => false,
Copy link
Contributor Author

@tannalynn tannalynn Feb 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These both are included in attributes.include now and are covered by the below line

:'attributes.include' => []

@@ -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
Copy link
Contributor Author

@tannalynn tannalynn Feb 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the instrumentation files that had named changed to @name= is due to a test we have that automatically checks to make sure all files using named have a config that matches the provided name.

Since the the config for grape is instrumentation.grape, the test was failing because it was checking for instrumentation.grape_instrumentation.

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[
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected destinations changed because the deprecated config was super old and didn't work with events

@@ -177,33 +177,10 @@ def test_message_parameters_disabled
end
end

def test_job_arguments_enabled
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted because these tests are only testing to make sure the new removed configs worked correctly. Since it is now treated like any other attribute, the tests for attribute.include now cover these situations.

@tannalynn tannalynn marked this pull request as ready for review February 3, 2023 19:30
Copy link
Contributor

@kaylareopelle kaylareopelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your comments within the PR were very helpful, @tannalynn. I have one small question, but it can be disregarded.

@kaylareopelle kaylareopelle self-requested a review February 3, 2023 19:53
Copy link
Contributor

@kaylareopelle kaylareopelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved! Feel free to put change log stuff in a separate PR :)

@tannalynn
Copy link
Contributor Author

Approved! Feel free to put change log stuff in a separate PR :)

Great idea, I'll do that!

@tannalynn tannalynn merged commit 57a2ee8 into major-release-9 Feb 3, 2023
@github-actions
Copy link

github-actions bot commented Feb 3, 2023

SimpleCov Report

Coverage Threshold
Line 93.97% 93%
Branch 85.45% 84%

@tannalynn tannalynn mentioned this pull request Feb 13, 2023
@tannalynn tannalynn deleted the remove_deprecated_configs branch June 23, 2023 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants