From 8b2b965217462ea66f702d8e14428b0c7c780286 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 17 Aug 2023 14:16:24 -0700 Subject: [PATCH 01/18] bugfix for inverted logic on AgentHooks.needed? --- lib/new_relic/rack/agent_hooks.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/new_relic/rack/agent_hooks.rb b/lib/new_relic/rack/agent_hooks.rb index 1c0f948870..504a80432c 100644 --- a/lib/new_relic/rack/agent_hooks.rb +++ b/lib/new_relic/rack/agent_hooks.rb @@ -23,7 +23,7 @@ module NewRelic::Rack # class AgentHooks < AgentMiddleware def self.needed? - !NewRelic::Agent.config[:disable_middleware_instrumentation] + NewRelic::Agent.config[:disable_middleware_instrumentation] end def traced_call(env) From 8cfb9d0e1e6db83ab9000fbeea356a4f73adfe18 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 17 Aug 2023 14:19:23 -0700 Subject: [PATCH 02/18] capture http status code if middleware instrumentation is disabled --- lib/new_relic/rack/agent_middleware.rb | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/lib/new_relic/rack/agent_middleware.rb b/lib/new_relic/rack/agent_middleware.rb index 0850b977f5..71bdffdedf 100644 --- a/lib/new_relic/rack/agent_middleware.rb +++ b/lib/new_relic/rack/agent_middleware.rb @@ -27,21 +27,17 @@ def build_transaction_name "#{prefix}#{self.class.name}/call" end - # If middleware tracing is disabled, we'll still inject our agent-specific - # middlewares, and still trace those, but we don't want to capture HTTP - # response codes, since middleware that's outside of ours might change the - # response code before it goes back to the client. - def capture_http_response_code(state, result) - return if NewRelic::Agent.config[:disable_middleware_instrumentation] - - super - end - - def capture_response_content_type(state, result) - return if NewRelic::Agent.config[:disable_middleware_instrumentation] - - super - end + # # If middleware tracing is disabled, we'll still inject our agent-specific + # # middlewares, and still trace those, but the http response code might be + # # changed by middleware outside of ours. We will still capute the response + # # code, but it is not guaranteed to be the final response code. + # def capture_http_response_code(state, result) + # super + # end + + # def capture_response_content_type(state, result) + # super + # end end end end From acdbde23cb0fe2901736f7af981a8bc8fbc53f43 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Mon, 21 Aug 2023 16:00:01 -0700 Subject: [PATCH 03/18] update changelog --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 107ea6dad2..db1324c831 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # New Relic Ruby Agent Release Notes + +## dev + +Version allows the agent to record the http status code on a transaction when middleware instrumentation is disabled + + +- **Feature: Transactions now report http status codes when middleware instrumentation is disabled** + Previously, if `disable_middleware_instrumentation` is set to true, the agent would not record the value of the response code on the transaction. This was due to the possibility that a middleware could be used that might alter the response, which would not be captured by the agent if the middleware instrumentation is disabled. However, based on customer feedback, the agent will now report the http status code on a transaction still when middleware instrumentation is disabled. [PR#]() + + ## v9.4.1 Version 9.4.1 of the agent resolves a `NoMethodError` introduced in 9.4.0. From e6ed7fcad8eb27492a15813071b6fe336ef4d03a Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Mon, 21 Aug 2023 16:00:15 -0700 Subject: [PATCH 04/18] update config description --- lib/new_relic/agent/configuration/default_source.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/new_relic/agent/configuration/default_source.rb b/lib/new_relic/agent/configuration/default_source.rb index 5ca0b0828f..e93ad84544 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -1212,7 +1212,13 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) :public => true, :type => Boolean, :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).' + :description => <<~DESCRIPTION + If `true`, the agent won't wrap third-party middlewares in instrumentation (regardless of whether they are installed via `Rack::Builder` or Rails). + + + When middleware instrumentation is disabled, if an application is using middleware that could alter the response code, the http status code reported on the transaction may not reflect the altered value. + + DESCRIPTION }, :disable_samplers => { :default => false, From 3a41c8b2ea94ee17f5557e30512123883fb93e85 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Mon, 21 Aug 2023 16:03:06 -0700 Subject: [PATCH 05/18] update tests to assert status code is now recorded when middleware instrumentation is disabled --- test/multiverse/suites/rack/http_response_code_test.rb | 6 +++--- test/multiverse/suites/rack/response_content_type_test.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/multiverse/suites/rack/http_response_code_test.rb b/test/multiverse/suites/rack/http_response_code_test.rb index 61800fbf0e..6a767b681f 100644 --- a/test/multiverse/suites/rack/http_response_code_test.rb +++ b/test/multiverse/suites/rack/http_response_code_test.rb @@ -35,17 +35,17 @@ def test_records_http_response_code_on_analytics_events assert_equal(302, get_last_analytics_event[2][:'http.statusCode']) end - def test_skips_http_response_code_if_middleware_tracing_disabled + def test_records_http_response_code_if_middleware_tracing_disabled with_config(:disable_middleware_instrumentation => true) do rsp = get('/', {'override-response-code' => 404}) assert_equal(404, rsp.status) - refute get_last_analytics_event[2][:'http.statusCode'] + assert get_last_analytics_event[2][:'http.statusCode'] rsp = get('/', {'override-response-code' => 302}) assert_equal(302, rsp.status) - refute get_last_analytics_event[2][:'http.statusCode'] + assert get_last_analytics_event[2][:'http.statusCode'] end end end diff --git a/test/multiverse/suites/rack/response_content_type_test.rb b/test/multiverse/suites/rack/response_content_type_test.rb index 69a10b47d4..8b389c4b7a 100644 --- a/test/multiverse/suites/rack/response_content_type_test.rb +++ b/test/multiverse/suites/rack/response_content_type_test.rb @@ -35,17 +35,17 @@ def test_records_response_content_type_on_analytics_events assert_equal('application/xml', get_last_analytics_event[2][:'response.headers.contentType']) end - def test_skips_response_content_type_if_middleware_tracing_disabled + def test_records_response_content_type_if_middleware_tracing_disabled with_config(:disable_middleware_instrumentation => true) do rsp = get('/', {'override-content-type' => 'application/json'}) assert_equal('application/json', rsp.headers['Content-Type']) - refute get_last_analytics_event[2][:'response.headers.contentType'] + assert get_last_analytics_event[2][:'response.headers.contentType'] rsp = get('/', {'override-content-type' => 'application/xml'}) assert_equal('application/xml', rsp.headers['Content-Type']) - refute get_last_analytics_event[2][:'response.headers.contentType'] + assert get_last_analytics_event[2][:'response.headers.contentType'] end end end From 5af510a6c872473823aafee3874dbcb3d8dede34 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 22 Aug 2023 13:14:58 -0700 Subject: [PATCH 06/18] add changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db1324c831..ae43a60714 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ Version allows the agent to record the http status code on a transaction w - **Feature: Transactions now report http status codes when middleware instrumentation is disabled** Previously, if `disable_middleware_instrumentation` is set to true, the agent would not record the value of the response code on the transaction. This was due to the possibility that a middleware could be used that might alter the response, which would not be captured by the agent if the middleware instrumentation is disabled. However, based on customer feedback, the agent will now report the http status code on a transaction still when middleware instrumentation is disabled. [PR#]() +- **Bugfix: Resolve inverted logic of `NewRelic::Rack::AgentHooks.needed?`** + Previously, `NewRelic::Rack::AgentHooks.needed?` was incorrectly using inverted logic. This has now been resolved. [PR#]() + ## v9.4.1 From 11398e1939b53704ca6d6b3f7365e01ea0713337 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 22 Aug 2023 13:16:48 -0700 Subject: [PATCH 07/18] update changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 892cbf0064..1296bc552d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,14 +3,14 @@ ## dev -Version allows the agent to record the http status code on a transaction when middleware instrumentation is disabled +Version allows the agent to record the http status code on a transaction when middleware instrumentation is disabled and fixes a bug in `NewRelic::Rack::AgentHooks.needed?. - **Feature: Transactions now report http status codes when middleware instrumentation is disabled** - Previously, if `disable_middleware_instrumentation` is set to true, the agent would not record the value of the response code on the transaction. This was due to the possibility that a middleware could be used that might alter the response, which would not be captured by the agent if the middleware instrumentation is disabled. However, based on customer feedback, the agent will now report the http status code on a transaction still when middleware instrumentation is disabled. [PR#]() + Previously, if `disable_middleware_instrumentation` is set to true, the agent would not record the value of the response code on the transaction. This was due to the possibility that a middleware could be used that might alter the response, which would not be captured by the agent if the middleware instrumentation is disabled. However, based on customer feedback, the agent will now report the http status code on a transaction still when middleware instrumentation is disabled. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) - **Bugfix: Resolve inverted logic of `NewRelic::Rack::AgentHooks.needed?`** - Previously, `NewRelic::Rack::AgentHooks.needed?` was incorrectly using inverted logic. This has now been resolved. [PR#]() + Previously, `NewRelic::Rack::AgentHooks.needed?` was incorrectly using inverted logic. This has now been resolved. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) ## v9.4.2 From a9849ee9067c39c71fe86650fdd60d110e512699 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 22 Aug 2023 13:18:39 -0700 Subject: [PATCH 08/18] remove commented code --- lib/new_relic/rack/agent_middleware.rb | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/new_relic/rack/agent_middleware.rb b/lib/new_relic/rack/agent_middleware.rb index 71bdffdedf..a018ebfaf4 100644 --- a/lib/new_relic/rack/agent_middleware.rb +++ b/lib/new_relic/rack/agent_middleware.rb @@ -26,18 +26,6 @@ def build_transaction_name prefix = ::NewRelic::Agent::Instrumentation::ControllerInstrumentation::TransactionNamer.prefix_for_category(nil, @category) "#{prefix}#{self.class.name}/call" end - - # # If middleware tracing is disabled, we'll still inject our agent-specific - # # middlewares, and still trace those, but the http response code might be - # # changed by middleware outside of ours. We will still capute the response - # # code, but it is not guaranteed to be the final response code. - # def capture_http_response_code(state, result) - # super - # end - - # def capture_response_content_type(state, result) - # super - # end end end end From 1cf7c98be2501d8274f26bb5c12fe96f3c01178d Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 22 Aug 2023 13:58:06 -0700 Subject: [PATCH 09/18] Update CHANGELOG.md Co-authored-by: James Bunch --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1296bc552d..06473d0f3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## dev -Version allows the agent to record the http status code on a transaction when middleware instrumentation is disabled and fixes a bug in `NewRelic::Rack::AgentHooks.needed?. +Version allows the agent to record the http status code on a transaction when middleware instrumentation is disabled and fixes a bug in `NewRelic::Rack::AgentHooks.needed?`. - **Feature: Transactions now report http status codes when middleware instrumentation is disabled** From d71461d42b0369ef468cf3741f28119df630eae4 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 22 Aug 2023 13:58:14 -0700 Subject: [PATCH 10/18] Update CHANGELOG.md Co-authored-by: James Bunch --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06473d0f3e..3bb609c389 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ Version allows the agent to record the http status code on a transaction w - **Feature: Transactions now report http status codes when middleware instrumentation is disabled** - Previously, if `disable_middleware_instrumentation` is set to true, the agent would not record the value of the response code on the transaction. This was due to the possibility that a middleware could be used that might alter the response, which would not be captured by the agent if the middleware instrumentation is disabled. However, based on customer feedback, the agent will now report the http status code on a transaction still when middleware instrumentation is disabled. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) + Previously, if `disable_middleware_instrumentation` is set to `true`, the agent would not record the value of the response code on the transaction. This was due to the possibility that a middleware could be used that might alter the response, which would not be captured by the agent if the middleware instrumentation is disabled. However, based on customer feedback, the agent will now report the http status code on a transaction still when middleware instrumentation is disabled. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) - **Bugfix: Resolve inverted logic of `NewRelic::Rack::AgentHooks.needed?`** Previously, `NewRelic::Rack::AgentHooks.needed?` was incorrectly using inverted logic. This has now been resolved. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) From 962004870833fca37c099adfb9d050a82429d85d Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 22 Aug 2023 13:59:43 -0700 Subject: [PATCH 11/18] capitalize http --- 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 e93ad84544..288afa49c4 100644 --- a/lib/new_relic/agent/configuration/default_source.rb +++ b/lib/new_relic/agent/configuration/default_source.rb @@ -1216,7 +1216,7 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) If `true`, the agent won't wrap third-party middlewares in instrumentation (regardless of whether they are installed via `Rack::Builder` or Rails). - When middleware instrumentation is disabled, if an application is using middleware that could alter the response code, the http status code reported on the transaction may not reflect the altered value. + When middleware instrumentation is disabled, if an application is using middleware that could alter the response code, the HTTP status code reported on the transaction may not reflect the altered value. DESCRIPTION }, From 0c383af855cd02bc644654be680b630f9c595ed6 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 22 Aug 2023 14:04:46 -0700 Subject: [PATCH 12/18] Update CHANGELOG.md Co-authored-by: Kayla Reopelle (she/her) <87386821+kaylareopelle@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bb609c389..ac0feaa523 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ Version allows the agent to record the http status code on a transaction w - **Feature: Transactions now report http status codes when middleware instrumentation is disabled** Previously, if `disable_middleware_instrumentation` is set to `true`, the agent would not record the value of the response code on the transaction. This was due to the possibility that a middleware could be used that might alter the response, which would not be captured by the agent if the middleware instrumentation is disabled. However, based on customer feedback, the agent will now report the http status code on a transaction still when middleware instrumentation is disabled. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) -- **Bugfix: Resolve inverted logic of `NewRelic::Rack::AgentHooks.needed?`** +- **Bugfix: Resolve inverted logic of NewRelic::Rack::AgentHooks.needed?** Previously, `NewRelic::Rack::AgentHooks.needed?` was incorrectly using inverted logic. This has now been resolved. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) From e03211062968a9fe78823018a95c9a778e04dd83 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 22 Aug 2023 14:05:49 -0700 Subject: [PATCH 13/18] Update CHANGELOG.md Co-authored-by: Kayla Reopelle (she/her) <87386821+kaylareopelle@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac0feaa523..782472744c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ Version allows the agent to record the http status code on a transaction w - **Feature: Transactions now report http status codes when middleware instrumentation is disabled** - Previously, if `disable_middleware_instrumentation` is set to `true`, the agent would not record the value of the response code on the transaction. This was due to the possibility that a middleware could be used that might alter the response, which would not be captured by the agent if the middleware instrumentation is disabled. However, based on customer feedback, the agent will now report the http status code on a transaction still when middleware instrumentation is disabled. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) +Previously, when `disable_middleware_instrumentation` was set to `true`, the agent would not record the value of the response code on the transaction. This was due to the possibility that a middleware could alter the response, which would not be captured by the agent when the middleware instrumentation was disabled. However, based on customer feedback, the agent will now report the HTTP status code on a transaction when middleware instrumentation is disabled. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) - **Bugfix: Resolve inverted logic of NewRelic::Rack::AgentHooks.needed?** Previously, `NewRelic::Rack::AgentHooks.needed?` was incorrectly using inverted logic. This has now been resolved. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) From ad97ce59cf4f0d8cd1e3bcd2f2c46eaafb6587e2 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 22 Aug 2023 14:09:10 -0700 Subject: [PATCH 14/18] add clarification to changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 782472744c..8f87ce7a60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,11 @@ Version allows the agent to record the http status code on a transaction when middleware instrumentation is disabled and fixes a bug in `NewRelic::Rack::AgentHooks.needed?`. -- **Feature: Transactions now report http status codes when middleware instrumentation is disabled** +- **Feature: Report transaction HTTP status codes when middleware instrumentation is disabled** Previously, when `disable_middleware_instrumentation` was set to `true`, the agent would not record the value of the response code on the transaction. This was due to the possibility that a middleware could alter the response, which would not be captured by the agent when the middleware instrumentation was disabled. However, based on customer feedback, the agent will now report the HTTP status code on a transaction when middleware instrumentation is disabled. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) - **Bugfix: Resolve inverted logic of NewRelic::Rack::AgentHooks.needed?** - Previously, `NewRelic::Rack::AgentHooks.needed?` was incorrectly using inverted logic. This has now been resolved. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) + Previously, `NewRelic::Rack::AgentHooks.needed?` was incorrectly using inverted logic. This has now been resolved, allowing AgentHooks to be installed when `disable_middleware_instrumentation` is set to true. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) ## v9.4.2 From 9accd95f7220b14d939161e71429bf395cdf4cb6 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 22 Aug 2023 14:12:18 -0700 Subject: [PATCH 15/18] reword changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f87ce7a60..664d18261e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ Version allows the agent to record the http status code on a transaction w Previously, when `disable_middleware_instrumentation` was set to `true`, the agent would not record the value of the response code on the transaction. This was due to the possibility that a middleware could alter the response, which would not be captured by the agent when the middleware instrumentation was disabled. However, based on customer feedback, the agent will now report the HTTP status code on a transaction when middleware instrumentation is disabled. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) - **Bugfix: Resolve inverted logic of NewRelic::Rack::AgentHooks.needed?** - Previously, `NewRelic::Rack::AgentHooks.needed?` was incorrectly using inverted logic. This has now been resolved, allowing AgentHooks to be installed when `disable_middleware_instrumentation` is set to true. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) + Previously, `NewRelic::Rack::AgentHooks.needed?` incorrectly used inverted logic. This has now been resolved, allowing AgentHooks to be installed when `disable_middleware_instrumentation` is set to true. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) ## v9.4.2 From d37132b24f08ffa32b060c71a129c6bd3447628a Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 22 Aug 2023 14:14:43 -0700 Subject: [PATCH 16/18] add content type to changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 664d18261e..0a0244ff9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ Version allows the agent to record the http status code on a transaction w - **Feature: Report transaction HTTP status codes when middleware instrumentation is disabled** -Previously, when `disable_middleware_instrumentation` was set to `true`, the agent would not record the value of the response code on the transaction. This was due to the possibility that a middleware could alter the response, which would not be captured by the agent when the middleware instrumentation was disabled. However, based on customer feedback, the agent will now report the HTTP status code on a transaction when middleware instrumentation is disabled. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) +Previously, when `disable_middleware_instrumentation` was set to `true`, the agent would not record the value of the response code or content type on the transaction. This was due to the possibility that a middleware could alter the response, which would not be captured by the agent when the middleware instrumentation was disabled. However, based on customer feedback, the agent will now report the HTTP status code and content type on a transaction when middleware instrumentation is disabled. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) - **Bugfix: Resolve inverted logic of NewRelic::Rack::AgentHooks.needed?** Previously, `NewRelic::Rack::AgentHooks.needed?` incorrectly used inverted logic. This has now been resolved, allowing AgentHooks to be installed when `disable_middleware_instrumentation` is set to true. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) From 85d0a4b757067af8c7767e1687b1eb0f6d88dacf Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 22 Aug 2023 14:30:33 -0700 Subject: [PATCH 17/18] Update CHANGELOG.md Co-authored-by: Kayla Reopelle (she/her) <87386821+kaylareopelle@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a0244ff9f..e07cd02117 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## dev -Version allows the agent to record the http status code on a transaction when middleware instrumentation is disabled and fixes a bug in `NewRelic::Rack::AgentHooks.needed?`. +Version allows the agent to record additional response information on a transaction when middleware instrumentation is disabled and fixes a bug in `NewRelic::Rack::AgentHooks.needed?`. - **Feature: Report transaction HTTP status codes when middleware instrumentation is disabled** From a8e2edb7b0f2d283cbc9f7c99b2dfd3b9101aa14 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 22 Aug 2023 14:30:47 -0700 Subject: [PATCH 18/18] Update CHANGELOG.md Co-authored-by: Kayla Reopelle (she/her) <87386821+kaylareopelle@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e07cd02117..2e3e0733ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ Version allows the agent to record additional response information on a tr - **Feature: Report transaction HTTP status codes when middleware instrumentation is disabled** -Previously, when `disable_middleware_instrumentation` was set to `true`, the agent would not record the value of the response code or content type on the transaction. This was due to the possibility that a middleware could alter the response, which would not be captured by the agent when the middleware instrumentation was disabled. However, based on customer feedback, the agent will now report the HTTP status code and content type on a transaction when middleware instrumentation is disabled. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) + Previously, when `disable_middleware_instrumentation` was set to `true`, the agent would not record the value of the response code or content type on the transaction. This was due to the possibility that a middleware could alter the response, which would not be captured by the agent when the middleware instrumentation was disabled. However, based on customer feedback, the agent will now report the HTTP status code and content type on a transaction when middleware instrumentation is disabled. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175) - **Bugfix: Resolve inverted logic of NewRelic::Rack::AgentHooks.needed?** Previously, `NewRelic::Rack::AgentHooks.needed?` incorrectly used inverted logic. This has now been resolved, allowing AgentHooks to be installed when `disable_middleware_instrumentation` is set to true. [PR#2175](https://github.com/newrelic/newrelic-ruby-agent/pull/2175)