scoutapp / scout_apm_ruby

ScoutAPM Ruby Agent. Supports Rails, Sinatra, Grape, Rack, and many other frameworks

Home Page:https://scoutapm.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scout throws warning with new version of Redis client 5.x

oboxodo opened this issue · comments

Scout gem version: 5.3.1

We're getting this message when loading our app, after upgrading to redis gem 5.x:

[Scout] [09/06/22 22:36:38 +0000 run.6739 (4)] WARN : Exception loading instruments:
[Scout] [09/06/22 22:36:38 +0000 run.6739 (4)] WARN : undefined method `call' for class `Redis::Client'

              alias_method :call_without_scout_instruments, :call
              ^^^^^^^^^^^^
Did you mean?  caller
[Scout] [09/06/22 22:36:38 +0000 run.6739 (4)] WARN : ["/app/vendor/bundle/ruby/3.1.0/gems/scout_apm-5.3.1/lib/scout_apm/instruments/redis.rb:40:in `alias_method'", "/app/vendor/bundle/ruby/3.1.0/gems/scout_apm-5.3.1/lib/scout_apm/instruments/redis.rb:40:in `block in install'", "/app/vendor/bundle/ruby/3.1.0/gems/scout_apm-5.3.1/lib/scout_apm/instruments/redis.rb:29:in `class_eval'", "/app/vendor/bundle/ruby/3.1.0/gems/scout_apm-5.3.1/lib/scout_apm/instruments/redis.rb:29:in `install'", "/app/vendor/bundle/ruby/3.1.0/gems/scout_apm-5.3.1/lib/scout_apm/instrument_manager.rb:82:in 

I found this commit undefining call and adding call_v to Redis::Client: redis/redis-rb@349ddb1#diff-5bc007010e6c2e0aa70b64d6f87985c20986ee1b2882b63a89b52659ee9c91f8L68-R73

So maybe it's an easy fix, adding some conditional depending on #call being defined or not?

Thanks for the report @oboxodo - I'm looking into this.

FYI I'm getting this too;

  • redis (5.0.4)
  • scout_apm (5.3.1)

Same warning with same versions:
redis (5.0.4)
scout_apm (5.3.1)

Support for redis client v5.0+ is now released on Scout v5.3.2