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

Update k8s boot/strap priority agent version #3018

Merged
merged 13 commits into from
Jan 17, 2025
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_<library_name>` configuration options in favor of `instrumentation.<library_name>`. 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:
Expand Down
7 changes: 4 additions & 3 deletions lib/boot/strap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/new_relic/boot/strap_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading