Skip to content

Commit

Permalink
Merge pull request #1792 from newrelic/NR745-remove-deprecated-method…
Browse files Browse the repository at this point in the history
…-disable-txn-tracing

Remove previously deprecated method `disable_transaction_tracing`
  • Loading branch information
hannahramadan authored Feb 4, 2023
2 parents 12573dd + bdf1a85 commit 47219eb
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 35 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
- Rainbows
- Sunspot

- **Dropped method: `NewRelic::Agent.disable_transaction_tracing`**

The previously deprecated `NewRelic::Agent.disable_transaction_tracing` method has been removed. Users are encouraged to use `NewRelic::Agent.disable_all_tracing` or `NewRelic::Agent.ignore_transaction`.

## 8.16.0

Version 8.16.0 introduces more Ruby on Rails instrumentation (especially for Rails 6 and 7) for various Action\*/Active\* libraries whose actions produce [Active Support notifications events](https://guides.rubyonrails.org/active_support_instrumentation.html).
Expand Down
12 changes: 0 additions & 12 deletions lib/new_relic/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -511,18 +511,6 @@ def disable_all_tracing
end
end

# This method disables the recording of transaction traces in the given
# block. See also #disable_all_tracing
#
# @api public
#
def disable_transaction_tracing
Deprecator.deprecate(:disable_transaction_tracing,
'disable_all_tracing or ignore_transaction')
record_api_supportability_metric(:disable_transaction_tracing)
yield
end

# This method sets the state of sql recording in the transaction
# sampler feature. Within the given block, no sql will be recorded
#
Expand Down
1 change: 0 additions & 1 deletion lib/new_relic/supportability_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ module SupportabilityHelper
:browser_timing_header,
:disable_all_tracing,
:disable_sql_recording,
:disable_transaction_tracing,
:drop_buffered_data,
:get_request_metadata,
:get_response_metadata,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
NewRelic::Agent.disable_all_tracing do
end

NewRelic::Agent.disable_transaction_tracing do
end

NewRelic::Agent.disable_sql_recording do
end

Expand Down
6 changes: 0 additions & 6 deletions test/new_relic/agent/supportability_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ def test_disable_sql_recording_records_supportability_metric
assert_api_supportability_metric_recorded(:disable_sql_recording)
end

def test_disable_transaction_tracing_records_supportability_metric
NewRelic::Agent.disable_transaction_tracing {}

assert_api_supportability_metric_recorded(:disable_transaction_tracing)
end

def test_ignore_apdex_records_supportability_metric
NewRelic::Agent.ignore_apdex

Expand Down
13 changes: 0 additions & 13 deletions test/new_relic/agent_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -464,19 +464,6 @@ def test_notice_error_returns_nil
end
end

def test_disable_transaction_tracing_deprecated
log = with_array_logger(:warn) do
NewRelic::Agent.disable_transaction_tracing do
in_transaction do |txn|
# no-op
end
end
end

assert log.array.any? { |msg| msg.include?('The method disable_transaction_tracing is deprecated.') }
assert log.array.any? { |msg| msg.include?('Please use disable_all_tracing or ignore_transaction instead.') }
end

def test_eventing_helpers
called = false
NewRelic::Agent.subscribe(:boo) { called = true }
Expand Down

0 comments on commit 47219eb

Please sign in to comment.