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

Active record instrumentation not expecting current_layer.desc to be a string

shadwell opened this issue · comments

I'm getting an error in instruments/active_record#log where current_layer.desc is a String.

NoMethodError: undefined method `merge' for "xxx":String
    scout_apm (4.0.4) lib/scout_apm/instruments/active_record.rb:255:in `log'
    activerecord (6.1.1) lib/active_record/connection_adapters/abstract_mysql_adapter.rb:204:in `execute'
    activerecord (6.1.1) lib/active_record/connection_adapters/mysql/database_statements.rb:50:in `execute'

It looks like it might be the Typhoeus instrumentation setting the desc to be the URL it's dealing with and then the active_record instrumentation expecting current_layer.desc to be an SqlList.

What I'm doing is calling Typhoeus in a callback in the active record model (in order to index a saved record to elasticsearch).

I'm also receiving this error when an exception is captured in our app's error tracker (Sentry). I thought it was similar to what was occurring in #378 but that has already been fixed.

Getting this too

@cschneid Any idea what this might be? It's preventing me from using Scout.

@wilg I downgraded the scout_apm gem to 4.0.1 (before the library added Typhoeus instrumentation, which seems to be creating this issue) and it's working well. You can temporarily use that version as a workaround.

Great, thanks!

We had this issue as well.
typhoeus.rb is returning desc as a string in other instrument files the layer is a Hash