Skip to content

Upgrade newrelic_rpm: 6.14.0 → 8.4.0 (major)#357

Closed
depfu[bot] wants to merge 1 commit intomasterfrom
depfu/update/newrelic_rpm-8.4.0
Closed

Upgrade newrelic_rpm: 6.14.0 → 8.4.0 (major)#357
depfu[bot] wants to merge 1 commit intomasterfrom
depfu/update/newrelic_rpm-8.4.0

Conversation

@depfu
Copy link

@depfu depfu bot commented Jan 26, 2022

Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ newrelic_rpm (6.14.0 → 8.4.0) · Repo · Changelog

Release Notes

8.4.0 (from changelog)

  • Provide basic support for Rails 7.0

This release includes Rails 7.0 as a tested Rails version. Updates build upon the agent's current Rails instrumentation and do not include additional instrumentation for new features.

  • Improve the performance of NewRelic::Agent::GuidGenerator#generate_guid

This method is called by many basic operations within the agent including transactions, datastore segments, and external request segments. Thank you, @jdelStrother for contributing this performance improvement!

  • Documentation: Development environment prep instructions

The multiverse collection of test suites requires a variety of data handling software (MySQL, Redis, memcached, etc.) to be available on the machine running the tests. The project documentation has been updated to outline the relevant software packages, and a Brewfile file has been added to automate software installation with Homebrew.

  • Bugfix: Add ControllerInstrumentation::Shims to Sinatra framework

    When the agent is disabled by setting the configuration settings enabled, agent_enabled, and/or monitor_mode to false, the agent loads shims for public controller instrumentation methods. These shims were missing for the Sinatra framework, causing applications to crash if the agent was disabled. Thank you, @NC-piercej for bringing this to our attention!

8.3.0 (from changelog)

  • Updated the agent to support Ruby 3.1.0

    Most of the changes involved updating the multiverse suite to exclude runs for older versions of instrumented gems that are not compatible with Ruby 3.1.0. In addition, Infinite Tracing testing was updated to accommodate YAML::unsafe_load for Psych 4 support.

  • Bugfix: Update AdaptiveSampler#sampled? algorithm

    One of the clauses in AdaptiveSampler#sampled? would always return false due to Integer division returning a result of zero. This method has been updated to use Float division instead, to exponentially back off the number of samples required. This may increase the number of traces collected for transactions. A huge thank you to @romul for bringing this to our attention and breaking down the problem!

  • Bugfix: Correctly encode ASCII-8BIT log messages

    The encoding update for the DecoratingLogger in v8.2.0 did not account for ASCII-8BIT encoded characters qualifying as valid_encoding?. Now, ASCII-8BIT characters will be encoded as UTF-8 and include replacement characters as needed. We're very grateful for @nikajukic's collaboration and submission of a test case to resolve this issue.

8.2.0 (from changelog)

  • New Instrumentation for Tilt gem

    Template rendering using Tilt is now instrumented. See PR #847 for details.

  • Configuration error_collector.ignore_errors is marked as deprecated

    This setting has been marked as deprecated in the documentation since version 7.2.0 and is now flagged as deprecated within the code.

  • Remove Rails 2 instrumentation

    Though any version of Rails 2 has not been supported by the Ruby Agent since v3.18.1.330, instrumentation for ActionController and ActionWebService specific to that version were still part of the agent. This instrumentation has been removed.

  • Remove duplicated settings from newrelic.yml

    Thank you @jakeonfire for bringing this to our attention and @kuroponzu for making the changes!

  • Bugfix: Span Events recorded when using newrelic_ignore

    Previously, the agent was incorrectly recording span events only on transactions that should be ignored. This fix will prevent any span events from being created for transactions using newrelic_ignore, or ignored through the rules.ignore_url_regexes configuration option.

  • Bugfix: Print deprecation warning for Cross-Application Tracing if enabled

    Prior to this change, the deprecation warning would log whenever the agent started up, regardless of configuration. Thank you @alpha-san for bringing this to our attention!

  • Bugfix: Scrub non-unicode characters from DecoratingLogger

    To prevent JSON::GeneratorErrors, the DecoratingLogger replaces non-unicode characters with the replacement character: �. Thank you @jdelStrother for bringing this to our attention!

  • Bugfix: Distributed tracing headers emitted errors when agent was not connected

    Previously, when the agent had not yet connected it would fail to create a trace context payload and emit an error, "TypeError: no implicit conversion of nil into String," to the agent logs. The correct behavior in this situation is to not create these headers due to the lack of required information. Now, the agent will not attempt to create trace context payloads until it has connected. Thank you @Izzette for bringing this to our attention!

8.1.0 (from changelog)

  • Instrumentation for Ruby standard library Logger

    The agent will now automatically instrument Logger, recording number of lines and size of logging output, with breakdown by severity.

  • Bugfix for Padrino instrumentation

    A bug was introduced to the way the agent installs padrino instrumentation in 7.0.0. This release fixes the issues with the padrino instrumentation. Thanks to @sriedel for bringing this issue to our attention.

  • Bugfix: Stop deadlocks between New Relic thread and Delayed Job sampling thread

    Running the agent's polling queries for the DelayedJobSampler within the same ActiveRecord connection decreases the frequency of deadlocks in development environments. Thanks @jdelStrother for bringing this to our attention and providing excellent sample code to speed up development!

  • Bugfix: Allow Net::HTTP request to IPv6 addresses

    The agent will no longer raise an URI::InvalidURIError error if an IPv6 address is passed to Net::HTTP. Thank you @tristinbarnett and @tabathadelane for crafting a solution!

  • Bugfix: Allow integers to be passed to error_collector.ignore_status_codes configuration

    Integers not wrapped in quotation marks can be passed to error_collector.ignore_status_codes in the newrelic.yml file. Our thanks goes to @elaguerta and @brammerl for resolving this issue!

8.0.0 (from changelog)

  • add_method_tracer refactored to use prepend over alias_method chaining

    This release overhauls the implementation of add_method_tracer, as detailed in issue #502. The main breaking updates are as follows:

    • A metric name passed to add_method_tracer will no longer be interpolated in an instance context as before. To maintain this behavior, pass a Proc object with the same arity as the method being traced. For example:

      # OLD
      add_method_tracer :foo, '#{args[0]}.#{args[1]}'

      # NEW
      add_method_tracer :foo, -> (*args) { "#{args[0]}.#{args[1]}" }

    • Similarly, the :code_header and :code_footer options to add_method_tracer will only accept a Proc object, which will be bound to the calling instance when the traced method is invoked.

    • Calling add_method_tracer for a method will overwrite any previously defined tracers for that method. To specify multiple metric names for a single method tracer, pass them to add_method_tracer as an array.

    See updated documentation on the following pages for full details:

  • Distributed tracing is enabled by default

    Distributed tracing tracks and observes service requests as they flow through distributed systems. Distributed tracing is now enabled by default and replaces cross application tracing.

  • Bugfix: Incorrectly loading configuration options from newrelic.yml

    The agent will now import the configuration options error_collector.ignore_messages and error_collector.expected_messages from the newrelic.yml file correctly.

  • Cross Application is now deprecated, and disabled by default

    Distributed tracing is replacing cross application tracing as the default means of tracing between services. To continue using it, enable it with cross_application_tracer.enabled: true and distributed_tracing.enabled: false

  • Update configuration option default value for span_events.max_samples_stored from 1000 to 2000

    For more information about this congfiguration option, visit the Ruby agent documentation.

  • Agent now enforces server supplied maximum value for configuration option span_events.max_samples_stored

    Upon connection to the New Relic servers, the agent will now enforce a maximum value allowed for the configuration option span_events.max_samples_stored sent from the New Relic servers.

  • Remove Ruby 2.0 required kwarg compatibility checks

    Our agent has code that provides compatibility for required keyword arguments in Ruby versions below 2.1. Since the agent now only supports Ruby 2.2+, this code is no longer required.

  • Replace Time.now with Process.clock_gettime

    Calls to Time.now have been replaced with calls to Process.clock_gettime to leverage the system's built-in clocks for elapsed time (Process::CLOCK_MONOTONIC) and wall-clock time (Process::CLOCK_REALTIME). This results in fewer object allocations, more accurate elapsed time records, and enhanced performance. Thanks to @sdemjanenko and @viraptor for advocating for this change!

  • Updated generated default newrelic.yml

    Thank you @wyhaines and @creaturenex for your contribution. The default newrelic.yml that the agent can generate is now updated with commented out examples of all configuration options.

  • Bugfix: Psych 4.0 causes errors when loading newrelic.yml

    Psych 4.0 now uses safe load behavior when using YAML.load which by default doesn't allow aliases, causing errors when the agent loads the config file. We have updated how we load the config file to avoid these errors.

  • Remove support for Excon versions below 0.19.0

    Excon versions below 0.19.0 will no longer be instrumented through the Ruby agent.

  • Remove support for Mongo versions below 2.1

    Mongo versions below 2.1 will no longer be instrumented through the Ruby agent.

  • Remove tests for Rails 3.0 and Rails 3.1

    As of the 7.0 release, the Ruby agent stopped supporting Rails 3.0 and Rails 3.1. Despite this, we still had tests for these versions running on the agent's CI. Those tests are now removed.

  • Update test Gemfiles for patched versions

    The gem has individual Gemfiles it uses to test against different common user setups. Rails 5.2, 6.0, and 6.1 have been updated to the latest patch versions in the test Gemfiles. Rack was updated in the Rails61 test suite to 2.1.4 to resolve a security vulnerability.

  • Remove Merb Support

    This release removes the remaining support for the Merb framework. It merged with Rails during the 3.0 release. Now that the Ruby agent supports Rails 3.2 and above, we thought it was time to say goodbye.

  • Remove deprecated method External.start_segment

    The method NewRelic::Agent::External.start_segment has been deprecated as of Ruby Agent 6.0.0. This method is now removed.

  • Added testing and support for the following gem versions

    • activemerchant 1.121.0
    • bunny 2.19.0
    • excon 0.85.0
    • mongo 2.14.0, 2.15.1
    • padrino 0.15.1
    • resque 2.1.0
    • sequel 5.48.0
    • yajl-ruby 1.4.1
  • This version adds support for ARM64/Graviton2 platform using Ruby 3.0.2+

7.2.0 (from changelog)

  • Expected Errors and Ignore Errors This release adds support for configuration for expected/ignored errors by class name, status code, and message. The following configuration options are now available:

    • error_collector.ignore_classes
    • error_collector.ignore_messages
    • error_collector.ignore_status_codes
    • error_collector.expected_classes
    • error_collector.expected_messages
    • error_collector.expected_status_codes For more details about expected and ignored errors, please see our configuration documentation
  • Bugfix: resolves "can't add a new key into hash during iteration" Errors

    Thanks to @wyhaines for this fix that prevents "can't add a new key into hash during iteration" errors from occuring when iterating over environment data.

  • Bugfix: kwarg support fixed for Rack middleware instrumentation

    Thanks to @walro for submitting this fix. This fixes the rack instrumentation when using kwargs.

  • Update known conflicts with use of Module#Prepend

    With our release of v7.0.0, we updated our instrumentation to use Module#Prepend by default, instead of method chaining. We have received reports of conflicts and added a check for these known conflicts. If a known conflict with prepend is detected while using the default value of 'auto' for gem instrumentation, the agent will instead install method chaining instrumentation in order to avoid this conflict. This check can be bypassed by setting the instrumentation method for the gem to 'prepend'.

7.1.0 (from changelog)

  • Add support for CSP nonces when using our API to insert the browser agent

    We now support passing in a nonce to our API method browser_timing_header to allow the browser agent to run on applications using CSP nonces. This allows users to inject the browser agent themselves and use the nonce required for the script to run. In order to utilize this new feature, you must disable auto instrumentation for the browser agent, and use the API method browser_timing_header to pass the nonce in and inject the script manually.

  • Removed MD5 use in the SQL sampler

    In order to allow the agent to run in FIPS compliant environments, the usage of MD5 for aggregating slow sql traces has been replaced with SHA1.

  • Enable server-side configuration of distributed tracing

    distributed_tracing.enabled may now be set in server-side application configuration.

  • Bugfix: Fix for missing part of a previous bugfix

    Our previous fix of "nil Middlewares injection now prevented and gracefully handled in Sinatra" released in 7.0.0 was partially overwritten by some of the other changes in that release. This release adds back those missing sections of the bugfix, and should resolve the issue for sinatra users.

  • Update known conflicts with use of Module#Prepend

    With our release of v7.0.0, we updated our instrumentation to use Module#Prepend by default, instead of method chaining. We have received reports of conflicts and added a check for these known conflicts. If a known conflict with prepend is detected while using the default value of 'auto' for gem instrumentation, the agent will instead install method chaining instrumentation in order to avoid this conflict. This check can be bypassed by setting the instrumentation method for the gem to 'prepend'.

  • Bugfix: Updated support for ActiveRecord 6.1+ instrumentation

    Previously, the agent depended on connection_id to be present in the Active Support instrumentation for sql.active_record to get the current ActiveRecord connection. As of Rails 6.1, connection_id has been dropped in favor of providing the connection object through the connection value exclusively. This resulted in datastore spans displaying fallback behavior, including showing "ActiveRecord" as the database vendor.

  • Bugfix: Updated support for Resque's FORK_PER_JOB option

    Support for Resque's FORK_PER_JOB flag within the Ruby agent was incomplete and nonfunctional. The agent should now behave correctly when running in a non-forking Resque worker process.

  • Bugfix: Added check for ruby2_keywords in add_transaction_tracer

    Thanks @beauraF for the contribution! Previously, the add_transaction_tracer was not updated when we added support for ruby 3. In order to correctly support **kwargs, ruby2_keywords was added to correctly update the method signature to use **kwargs in ruby versions that support that.

  • Confirmed support for yajl 1.4.0

    Thanks to @creaturenex for the contribution! yajl-ruby 1.4.0 was added to our test suite and confirmed all tests pass, showing the agent supports this version as well.

7.0.0 (from changelog)

  • Ruby Agent 6.x to 7.x Migration Guide Available

    Please see our Ruby Agent 6.x to 7.x migration guide for helpful strategies and tips for migrating from earlier versions of the Ruby agent to 7.0.0. We cover new configuration settings, diagnosiing and installing SSL CA certificates and deprecated items and their replacements in this guide.

  • Ruby 2.0 and 2.1 Dropped

    Support for Ruby 2.0 and 2.1 dropped with this release. No code changes that would prevent the agent from continuing to work with these releases are known. However, Rubies 2.0 and 2.1 are no longer included in our test matrices and are not supported for 7.0.0 and onward.

  • Implemented prepend auto-instrumentation strategies for most Ruby gems/libraries

    This release brings the auto-instrumentation strategies for most gems into the modern era for Ruby by providing both prepend and method-chaining (a.k.a. method-aliasing) strategies for auto instrumenting. Prepend, which has been available since Ruby 2.0 is now the default strategy employed in auto-instrumenting. It is known that some external gems lead to Stack Level too Deep exceptions when prepend and method-chaining are mixed. In such known cases, auto-instrumenting strategy will fall back to method-chaining automatically.

    This release also deprecates many overlapping and inconsistently named configuration settings in favor of being able to control behavior of instrumentation per library with one setting that can be one of auto (the default), disabled, prepend, or chain.

    Please see the above-referenced migration guide for further details.

  • Removed SSL cert bundle

    The agent will no longer ship this bundle and will rely on system certs.

  • Removed deprecated config options

    The following config options were previously deprecated and are no longer available

    • disable_active_record_4
    • disable_active_record_5
    • autostart.blacklisted_constants
    • autostart.blacklisted_executables
    • autostart.blacklisted_rake_tasks
    • strip_exception_messages.whitelist
  • Removed deprecated attribute

    The attribute httpResponseCode was previously deprecated and replaced with http.statusCode. This deprecated attribute has now been removed.

  • Removed deprecated option in notice_error

    Previously, the :trace_only option to NewRelic::Agent.notice_error was deprecated and replaced with :expected. This deprecated option has been removed.

  • Removed deprecated api methods

    Previously the api methods create_distributed_trace_payload and accept_distributed_trace_payload were deprecated. These have now been removed. Instead, please see insert_distributed_trace_headers and accept_distributed_trace_headers, respectively.

  • Bugfix: Prevent browser monitoring middleware from installing to middleware multiple times

    In rare cases on jRuby, the BrowserMonitoring middleware could attempt to install itself multiple times at start up. This bug fix addresses that by using a mutex to introduce thread safety to the operation. Sintra in particular can have this race condition because its middleware stack is not installed until the first request is received.

  • Skip constructing Time for transactions

    Thanks to @viraptor, we are no longer constructing an unused Time object with every call to starting a new Transaction.

  • Bugfix: nil Middlewares injection now prevented and gracefully handled in Sinatra

    Previously, the agent could potentially inject multiples of an instrumented middleware if Sinatra received many requests at once during start up and initialization due to Sinatra's ability to delay full start up as long as possible. This has now been fixed and the Ruby agent correctly instruments only once as well as gracefully handles nil middleware classes in general.

  • Bugfix: Ensure transaction nesting max depth is always consistent with length of segments

    Thanks to @warp for noticing and fixing the scenario where Transaction nesting_max_depth can get out of sync with segments length resulting in an exception when attempting to nest the initial segment which does not exist.

Does any of this look wrong? Please let us know.


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfu
Copy link
Author

depfu bot commented Feb 26, 2022

Closed in favor of #367.

@depfu depfu bot closed this Feb 26, 2022
@depfu depfu bot deleted the depfu/update/newrelic_rpm-8.4.0 branch February 26, 2022 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant