Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging autoinstrument layers that are significant/insignicant + ignoring files #283

Merged
merged 6 commits into from
Sep 23, 2019

Conversation

itsderek23
Copy link
Contributor

@itsderek23 itsderek23 commented Sep 19, 2019

Instrumenting many insignificant layers adds overhead. These insignificant layers are unlikely to be areas a developer will optimize. This adds a persistant Histogram that logs a count of total autoinstrumented layers and the percent significant per-file name.

In the example output below, application_controller.rb is potentially adding overhead as it is tracking a large number of layers and a low percentage (8%) are significant. This file can be excluded from autoinstruments via the new autoinstruments config option: auto_instruments_ignore: ['application_controller'].

[09/19/19 10:55:36 -0600 Dereks-MacBook-Pro.local (66345)] DEBUG : AutoInstrument Layer Histograms: {"/Users/dlite/projects/scout/apm/app/controllers/application_controller.rb"=>
  {:total=>1774, :significant=>0.08},
 "/Users/dlite/projects/scout/apm/app/controllers/status_pages_controller.rb"=>
  {:total=>5, :significant=>0.2},
 "/Users/dlite/projects/scout/apm/app/controllers/checkin_controller.rb"=>
  {:total=>52, :significant=>0.23},
 "/Users/dlite/projects/scout/apm/app/controllers/deploys_controller.rb"=>
  {:total=>15, :significant=>0.2},
 "/Users/dlite/projects/scout/apm/app/controllers/apps_controller.rb"=>
  {:total=>57, :significant=>0.46},
 "/Users/dlite/projects/scout/apm/app/controllers/errors_controller.rb"=>
  {:total=>4, :significant=>1.0},
 "/Users/dlite/projects/scout/apm/app/controllers/insights_controller.rb"=>
  {:total=>4, :significant=>1.0},
 "/Users/dlite/projects/scout/apm/app/controllers/alerts_controller.rb"=>
  {:total=>8, :significant=>0.25},
 "/Users/dlite/projects/scout/apm/app/controllers/traces_controller.rb"=>
  {:total=>12, :significant=>0.42},
 "/Users/dlite/projects/scout/apm/app/controllers/endpoints_controller.rb"=>
  {:total=>22, :significant=>0.32}}

Instrumenting many insignificant layers adds overhead. These insignificant layers are unlikely to be areas a developer will optimize. This adds a persistant Histogram that logs a count of total autoinstrumented layers and the percent significant per-file name.

```
[09/19/19 10:55:36 -0600 Dereks-MacBook-Pro.local (66345)] DEBUG : AutoInstrument Layer Histograms: {"/Users/dlite/projects/scout/apm/app/controllers/application_controller.rb"=>
  {:total=>1774, :significant=>0.08},
 "/Users/dlite/projects/scout/apm/app/controllers/status_pages_controller.rb"=>
  {:total=>5, :significant=>0.2},
 "/Users/dlite/projects/scout/apm/app/controllers/checkin_controller.rb"=>
  {:total=>52, :significant=>0.23},
 "/Users/dlite/projects/scout/apm/app/controllers/deploys_controller.rb"=>
  {:total=>15, :significant=>0.2},
 "/Users/dlite/projects/scout/apm/app/controllers/apps_controller.rb"=>
  {:total=>57, :significant=>0.46},
 "/Users/dlite/projects/scout/apm/app/controllers/errors_controller.rb"=>
  {:total=>4, :significant=>1.0},
 "/Users/dlite/projects/scout/apm/app/controllers/insights_controller.rb"=>
  {:total=>4, :significant=>1.0},
 "/Users/dlite/projects/scout/apm/app/controllers/alerts_controller.rb"=>
  {:total=>8, :significant=>0.25},
 "/Users/dlite/projects/scout/apm/app/controllers/traces_controller.rb"=>
  {:total=>12, :significant=>0.42},
 "/Users/dlite/projects/scout/apm/app/controllers/endpoints_controller.rb"=>
  {:total=>22, :significant=>0.32}}
```
This adds a `auto_instruments_ignore` config option so files can be excluded from autoinstruments. By defaut this is an empty array. Example usage: `auto_instruments_ignore: ['application_controller']`.
@itsderek23 itsderek23 changed the title [WIP] logging autoinstrument layers that are significant/insignicant [WIP] Logging autoinstrument layers that are significant/insignicant + ignoring files Sep 23, 2019
@itsderek23 itsderek23 changed the title [WIP] Logging autoinstrument layers that are significant/insignicant + ignoring files Logging autoinstrument layers that are significant/insignicant + ignoring files Sep 23, 2019
@itsderek23 itsderek23 merged commit e05dcde into master Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants