diff --git a/CHANGELOG.md b/CHANGELOG.md index 56f8ba42ec..c25db7fb65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The agent now supports Ruby 3.4.0. We've made incremental changes throughout the preview stage to reach compatibility. This release includes an update to the Thread Profiler for compatibility with Ruby 3.4.0's new backtrace format. [Issue#2992](https://github.com/newrelic/newrelic-ruby-agent/issues/2992) [PR#2997](https://github.com/newrelic/newrelic-ruby-agent/pull/2997) +- **Feature: Kubernetes APM auto-attach - new agent version precedent** + + Previously, when a customer installed the Ruby agent via [Kubernetes APM auto-attach](https://docs.newrelic.com/docs/kubernetes-pixie/kubernetes-integration/installation/k8s-agent-operator/) and also had the Ruby agent listed in their `Gemfile`, the agent version in `Gemfile` would take precedence. Now, the agent version installed by auto-attach takes priority. [PR#3018](https://github.com/newrelic/newrelic-ruby-agent/pull/3018) + - **Bugfix: Stop emitting inaccurate debug-level log about deprecated configuration options** In the previous major release, we dropped support for `disable_` configuration options in favor of `instrumentation.`. Previously, a DEBUG level log warning appeared whenever `disable_*` options were set to `true`, even for libraries (e.g. Action Dispatch) without equivalent `instrumentation.*` options: diff --git a/lib/boot/strap.rb b/lib/boot/strap.rb index 7b6ac650f8..ee5f8fbbd9 100644 --- a/lib/boot/strap.rb +++ b/lib/boot/strap.rb @@ -44,14 +44,15 @@ module NRBundlerPatch NR_AGENT_GEM = 'newrelic_rpm' def require(*_groups) - super - require_newrelic + + super end def require_newrelic lib = File.expand_path('../..', __FILE__) - $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) + $LOAD_PATH.reject! { |path| path.include?('newrelic_rpm') } + $LOAD_PATH.unshift(lib) Kernel.require NR_AGENT_GEM end end diff --git a/test/new_relic/boot/strap_test.rb b/test/new_relic/boot/strap_test.rb index f22d880421..e93ac1de87 100644 --- a/test/new_relic/boot/strap_test.rb +++ b/test/new_relic/boot/strap_test.rb @@ -26,7 +26,7 @@ def test_the_overall_prepend_based_monkeypatch end assert_equal 2, required_gems.size, "Expected 2 gems to be required, saw #{required_gems.size}." - assert_equal [PhonyBundler::DEFAULT_GEM_NAME, 'newrelic_rpm'], required_gems, + assert_equal ['newrelic_rpm', PhonyBundler::DEFAULT_GEM_NAME], required_gems, "Expected to see 'newrelic_rpm' required. Only saw #{required_gems}" end