Rack middlewares are automatically instrumented with Ruby agent version 3.9.0 or higher.
The NewRelic::Agent::Instrumentation::Rack module was removed in Ruby agent version 4.0.0. Remove any references to this module from your code. For more information, see Instrumenting Metal controllers.