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

AutoInstrumentation is enabled but not working

pawurb opened this issue · comments

Hi. I'm using ScoutAPM in a few projects. Since recently I've stopped receiving auto_instrumentation data. All the projects use scout_apm (5.3.5) with different versions of Rails and Ruby (raging from 6.1-7.0 and 2.6.6-3.1.2).

I'm using the following config/scout_apm.yml:

common: &defaults
  auto_instruments: true

But in traces data I can see following error showing that auto instrumentation does not work:

Screenshot 2023-10-22 at 16 26 48

After enabling log_level: debug I've managed to extract the following logs:

app[web.1]: [Scout] [10/22/23 14:29:02 +0000 web.1 (7)] DEBUG : AutoInstrument Significant Layer Histograms: {}

On app's startup I can see the following logs output:

     [Scout] [10/22/23 14:35:06 +0000 web.1 (7)] INFO : Instrumenting ActionController (on_load)
       [Scout] [10/22/23 14:35:06 +0000 web.1 (7)] INFO : Instrumenting ActionController::Base
       [Scout] [10/22/23 14:35:06 +0000 web.1 (7)] INFO : Instrumenting ActionController::Metal
       [Scout] [10/22/23 14:35:06 +0000 web.1 (7)] INFO : Instrumenting ActionController::Api
       [Scout] [10/22/23 14:35:06 +0000 web.1 (7)] INFO : Skipping ActionController - Already Ran
       [Scout] [10/22/23 14:35:06 +0000 web.1 (7)] DEBUG : Using synchronous recording
       [Scout] [10/22/23 14:35:06 +0000 web.1 (7)] DEBUG : got response: #<Net::HTTPOK 200 OK readbody=true>
       [Scout] [10/22/23 14:35:06 +0000 web.1 (7)] DEBUG : app_server_load OK
       [Scout] [10/22/23 14:35:06 +0000 web.1 (7)] DEBUG : Finished sending Startup Info
       [Scout] [10/22/23 14:35:07 +0000 web.1 (7)] INFO : Instrumenting ActiveRecord::ConnectionAdapters::AbstractAdapter
       [Scout] [10/22/23 14:35:07 +0000 web.1 (7)] INFO : Instrumenting ActiveRecord::Querying - ActiveRecord::Querying
       [Scout] [10/22/23 14:35:07 +0000 web.1 (7)] INFO : Instrumenting ActiveRecord::Relation#exec_queries - ActiveRecord::Relation (prepending)

So, it looks like auto_instrumentation is enabled but not gathering any data.

Any tips on how this issue can be resolved will be appreciated.

Hey @pawurb,

Do you see the following log on application start/restart?
AutoInstruments is enabled, but Parser::TreeRewriter is missing.

It may be related to:
#445

Can you reach out to us at support@scoutapm.com?

Adding parser to Gemfile resolved the issue. Maybe you could add this info to the docs?

I did not find this error mesage in any of the logs.