Skip to content

Commit

Permalink
Merge pull request #2159 from newrelic/rack_2plus
Browse files Browse the repository at this point in the history
CI allow_all_headers requires Rack v2+
  • Loading branch information
fallwith committed Aug 11, 2023
2 parents aabe6c7 + 7c0d3fe commit 7ceb153
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Version <dev> of the agent adds [Roda](https://roda.jeremyevans.net/) instrument

A new `allow_all_headers` configuration parameter brings parity with the Node.js agent (see the [v2.7.0 changelog](https://docs.newrelic.com/docs/release-notes/agent-release-notes/nodejs-release-notes/node-agent-270/)). This configuration parameter defaults to a value of `false`. When set to `true`, and as long as the agent is not operating in high-security mode, all HTTP headers gleaned from a request will be captured and relayed to New Relic instead of the default core set of headers. All existing behavior for `.*attributes.include` and `.*attributes.exclude` configuration parameters will be respected for any desired filtration of the headers when `allow_all_headers` is enabled. This work was done in response to a feature request submitted by community member [@jamesarosen](https://github.com/jamesarosen). Thank you very much, @jamesarosen! [Issue#1029](https://github.com/newrelic/newrelic-ruby-agent/issues/1029)

NOTE: The extra headers collected by having `allow_all_headers` enabled requires Rack version 2 or higher.
NOTE: The extra headers will appear as attributes prefixed with `request.headers.`

- **Feature: Improved error tracking transaction linking**

Errors tracked and sent to the New Relic errors inbox will now be associated with a transaction id to enable improved UI/UX associations between transactions and errors. [PR#2035](https://github.com/newrelic/newrelic-ruby-agent/pull/2035)
Expand Down
7 changes: 0 additions & 7 deletions test/helpers/misc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,6 @@ def skip_unless_minitest5_or_above
skip 'This test requires MiniTest v5+'
end

def skip_unless_no_rails_or_rails_version_at_or_above(min_version)
return unless defined?(Rails) && Rails.respond_to?(:version)
return if Gem::Version.new(Rails.version) >= Gem::Version.new(min_version)

skip "This test requires no Rails or Rails >= v#{min_version}"
end

def skip_unless_ci_cron
return if ENV['CI_CRON']

Expand Down
4 changes: 2 additions & 2 deletions test/new_relic/agent/transaction/request_attributes_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def test_by_default_only_a_base_set_of_request_headers_are_captured
end

def test_if_allow_all_headers_is_specified_then_allow_them_all
skip_unless_no_rails_or_rails_version_at_or_above(5.2)
skip 'Test requires Rack v2+' unless Rack.respond_to?(:release) && !Rack.release.start_with?('1.')
skip_unless_minitest5_or_above

with_config(allow_all_headers: true) do
Expand Down Expand Up @@ -236,7 +236,7 @@ def test_the_use_of_attributes_include_as_an_allowlist
end

def test_the_use_of_attributes_exclude_as_a_blocklist
skip_unless_no_rails_or_rails_version_at_or_above(5.2)
skip 'Test requires Rack v2+' unless Rack.respond_to?(:release) && !Rack.release.start_with?('1.')
skip_unless_minitest5_or_above

excluded_header = :'request.headers.customHeader'
Expand Down

0 comments on commit 7ceb153

Please sign in to comment.