scout_apm 3.0.0.pre28 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -1
  3. data/.rubocop.yml +3 -4
  4. data/.travis.yml +17 -14
  5. data/CHANGELOG.markdown +124 -4
  6. data/Gemfile +1 -7
  7. data/README.markdown +13 -4
  8. data/Rakefile +1 -1
  9. data/ext/allocations/allocations.c +2 -0
  10. data/gems/README.md +28 -0
  11. data/gems/octoshark.gemfile +4 -0
  12. data/gems/rails3.gemfile +5 -0
  13. data/gems/rails4.gemfile +4 -0
  14. data/gems/rails5.gemfile +4 -0
  15. data/gems/rails6.gemfile +4 -0
  16. data/lib/scout_apm.rb +37 -9
  17. data/lib/scout_apm/agent.rb +29 -10
  18. data/lib/scout_apm/agent/exit_handler.rb +0 -1
  19. data/lib/scout_apm/agent_context.rb +22 -3
  20. data/lib/scout_apm/app_server_load.rb +7 -2
  21. data/lib/scout_apm/attribute_arranger.rb +0 -2
  22. data/lib/scout_apm/auto_instrument.rb +5 -0
  23. data/lib/scout_apm/auto_instrument/instruction_sequence.rb +31 -0
  24. data/lib/scout_apm/auto_instrument/layer.rb +23 -0
  25. data/lib/scout_apm/auto_instrument/parser.rb +27 -0
  26. data/lib/scout_apm/auto_instrument/rails.rb +175 -0
  27. data/lib/scout_apm/background_job_integrations/legacy_sneakers.rb +55 -0
  28. data/lib/scout_apm/background_job_integrations/que.rb +134 -0
  29. data/lib/scout_apm/background_job_integrations/resque.rb +6 -2
  30. data/lib/scout_apm/background_job_integrations/shoryuken.rb +124 -0
  31. data/lib/scout_apm/background_job_integrations/sidekiq.rb +5 -19
  32. data/lib/scout_apm/background_job_integrations/sneakers.rb +87 -0
  33. data/lib/scout_apm/config.rb +45 -8
  34. data/lib/scout_apm/detailed_trace.rb +217 -0
  35. data/lib/scout_apm/environment.rb +3 -0
  36. data/lib/scout_apm/error.rb +27 -0
  37. data/lib/scout_apm/error_service.rb +32 -0
  38. data/lib/scout_apm/error_service/error_buffer.rb +39 -0
  39. data/lib/scout_apm/error_service/error_record.rb +211 -0
  40. data/lib/scout_apm/error_service/ignored_exceptions.rb +66 -0
  41. data/lib/scout_apm/error_service/middleware.rb +32 -0
  42. data/lib/scout_apm/error_service/notifier.rb +33 -0
  43. data/lib/scout_apm/error_service/payload.rb +47 -0
  44. data/lib/scout_apm/error_service/periodic_work.rb +17 -0
  45. data/lib/scout_apm/error_service/railtie.rb +11 -0
  46. data/lib/scout_apm/error_service/sidekiq.rb +80 -0
  47. data/lib/scout_apm/extensions/transaction_callback_payload.rb +1 -1
  48. data/lib/scout_apm/fake_store.rb +3 -0
  49. data/lib/scout_apm/framework_integrations/rails_2.rb +2 -1
  50. data/lib/scout_apm/framework_integrations/rails_3_or_4.rb +3 -1
  51. data/lib/scout_apm/git_revision.rb +6 -3
  52. data/lib/scout_apm/instant/middleware.rb +2 -1
  53. data/lib/scout_apm/instrument_manager.rb +8 -7
  54. data/lib/scout_apm/instruments/action_controller_rails_2.rb +3 -1
  55. data/lib/scout_apm/instruments/action_controller_rails_3_rails4.rb +56 -55
  56. data/lib/scout_apm/instruments/action_view.rb +114 -26
  57. data/lib/scout_apm/instruments/active_record.rb +62 -18
  58. data/lib/scout_apm/instruments/http.rb +48 -0
  59. data/lib/scout_apm/instruments/memcached.rb +43 -0
  60. data/lib/scout_apm/instruments/mongoid.rb +9 -4
  61. data/lib/scout_apm/instruments/net_http.rb +8 -1
  62. data/lib/scout_apm/job_record.rb +4 -2
  63. data/lib/scout_apm/layaway_file.rb +4 -0
  64. data/lib/scout_apm/layer.rb +5 -56
  65. data/lib/scout_apm/layer_children_set.rb +9 -8
  66. data/lib/scout_apm/layer_converters/converter_base.rb +15 -30
  67. data/lib/scout_apm/layer_converters/slow_job_converter.rb +12 -2
  68. data/lib/scout_apm/layer_converters/slow_request_converter.rb +14 -4
  69. data/lib/scout_apm/layer_converters/trace_converter.rb +184 -0
  70. data/lib/scout_apm/limited_layer.rb +0 -7
  71. data/lib/scout_apm/metric_stats.rb +0 -8
  72. data/lib/scout_apm/middleware.rb +1 -1
  73. data/lib/scout_apm/periodic_work.rb +19 -0
  74. data/lib/scout_apm/remote/message.rb +4 -0
  75. data/lib/scout_apm/reporter.rb +8 -3
  76. data/lib/scout_apm/reporting.rb +2 -1
  77. data/lib/scout_apm/request_histograms.rb +8 -0
  78. data/lib/scout_apm/serializers/app_server_load_serializer.rb +4 -0
  79. data/lib/scout_apm/serializers/directive_serializer.rb +4 -0
  80. data/lib/scout_apm/serializers/payload_serializer.rb +2 -2
  81. data/lib/scout_apm/serializers/payload_serializer_to_json.rb +30 -15
  82. data/lib/scout_apm/slow_job_record.rb +5 -1
  83. data/lib/scout_apm/slow_policy/age_policy.rb +33 -0
  84. data/lib/scout_apm/slow_policy/percent_policy.rb +22 -0
  85. data/lib/scout_apm/slow_policy/percentile_policy.rb +24 -0
  86. data/lib/scout_apm/slow_policy/policy.rb +21 -0
  87. data/lib/scout_apm/slow_policy/speed_policy.rb +16 -0
  88. data/lib/scout_apm/slow_request_policy.rb +18 -77
  89. data/lib/scout_apm/slow_transaction.rb +3 -1
  90. data/lib/scout_apm/store.rb +0 -1
  91. data/lib/scout_apm/tracked_request.rb +39 -30
  92. data/lib/scout_apm/utils/backtrace_parser.rb +3 -0
  93. data/lib/scout_apm/utils/marshal_logging.rb +90 -0
  94. data/lib/scout_apm/utils/sql_sanitizer.rb +10 -1
  95. data/lib/scout_apm/utils/sql_sanitizer_regex.rb +7 -0
  96. data/lib/scout_apm/utils/sql_sanitizer_regex_1_8_7.rb +6 -0
  97. data/lib/scout_apm/utils/unique_id.rb +27 -0
  98. data/lib/scout_apm/version.rb +1 -1
  99. data/scout_apm.gemspec +13 -7
  100. data/test/test_helper.rb +2 -2
  101. data/test/unit/agent_context_test.rb +29 -0
  102. data/test/unit/auto_instrument/assignments-instrumented.rb +31 -0
  103. data/test/unit/auto_instrument/assignments.rb +31 -0
  104. data/test/unit/auto_instrument/controller-ast.txt +57 -0
  105. data/test/unit/auto_instrument/controller-instrumented.rb +49 -0
  106. data/test/unit/auto_instrument/controller.rb +49 -0
  107. data/test/unit/auto_instrument/rescue_from-instrumented.rb +13 -0
  108. data/test/unit/auto_instrument/rescue_from.rb +13 -0
  109. data/test/unit/auto_instrument_test.rb +54 -0
  110. data/test/unit/error_service/error_buffer_test.rb +25 -0
  111. data/test/unit/error_service/ignored_exceptions_test.rb +49 -0
  112. data/test/unit/instruments/active_record_test.rb +40 -0
  113. data/test/unit/layer_children_set_test.rb +9 -0
  114. data/test/unit/request_histograms_test.rb +17 -0
  115. data/test/unit/serializers/payload_serializer_test.rb +39 -5
  116. data/test/unit/slow_request_policy_test.rb +41 -13
  117. data/test/unit/sql_sanitizer_test.rb +47 -0
  118. metadata +99 -19
  119. data/ext/stacks/extconf.rb +0 -38
  120. data/ext/stacks/scout_atomics.h +0 -86
  121. data/ext/stacks/stacks.c +0 -814
  122. data/lib/scout_apm/slow_job_policy.rb +0 -111
  123. data/lib/scout_apm/trace_compactor.rb +0 -312
  124. data/lib/scout_apm/utils/fake_stacks.rb +0 -88
  125. data/test/unit/instruments/active_record_instruments_test.rb +0 -5
  126. data/test/unit/slow_job_policy_test.rb +0 -6
  127. data/tester.rb +0 -53
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f2d0813402ccb2bbedb7ce81d0de22cff013d477
4
- data.tar.gz: 32a5467192d8677b641e4e195b197eca7337c6e0
2
+ SHA256:
3
+ metadata.gz: ffcf571075c7f443ebe029e8f07c726cc5cb6c12e156d47e2565c576ac671316
4
+ data.tar.gz: 684f8ed4ba52d2e5819ea319288333a83f8b5481491ae879be2e8031cdd5d6ee
5
5
  SHA512:
6
- metadata.gz: db361b9cc1a2c0c23a70c3165b391788d44150a34c8cc37b858d004d62660d829d89714f3dc96a7e9f519713ebdee4b06c04ab5da6375a29937617b5d860b58b
7
- data.tar.gz: f8b2c30c07950cbaf5377c805a5e41eb06d3c6b423f9a3027712987d3ae652dbe11032cb6c911f94141b9f547c9d98c9eced4533e64a38fabed533b6f96e5fea
6
+ metadata.gz: a4d90917dc02469213092848211fe779f44ec09e7db4829aaaa737ca15cf1811137dc2a4ae00adaa76cc2be92916b0467f164f79a76fac501c7a4827ba5d6f7d
7
+ data.tar.gz: 776d064902d998cc69330e470fbc9bfb368ae401d8e8a341310e4dc2a9070a256a2e57370505ee3475761d26145e4efced633963243527e39b95ab584bf48b2a
data/.gitignore CHANGED
@@ -17,5 +17,5 @@ test/tmp/*coverage/*
17
17
  coverage/*
18
18
  lib/*.bundle
19
19
  lib/*.so
20
- **/.RUBYARCHDIR.time
21
20
  log/scout_apm.log
21
+ gems/*.lock
@@ -1,13 +1,12 @@
1
1
  # Disable all cops by default
2
2
  AllCops:
3
3
  DisabledByDefault: true
4
+ Exclude:
5
+ - 'test/unit/auto_instrument/*'
6
+ - vendor/bundle/**/*
4
7
 
5
8
  # 80 is stifling, especially with a few levels of nesting before we even start.
6
9
  # So bump it to 100 to keep really long lines from creeping in.
7
10
  Metrics/LineLength:
8
11
  Enabled: false
9
12
  Max: 100
10
-
11
- Style/HashSyntax:
12
- Enabled: true
13
- EnforcedStyle: hash_rockets
@@ -1,17 +1,20 @@
1
1
  language: ruby
2
- rvm:
3
- - "1.8.7"
4
- - "1.9.3"
5
- - "2.0"
6
- - "2.2"
7
- - "2.4"
8
- - "2.5"
2
+ dist: trusty
9
3
  cache: bundler
10
- before_install:
11
- - gem update --system
12
- - gem install bundler
13
- jobs:
4
+
5
+ matrix:
14
6
  include:
15
- - script: bundle exec rake test
16
- - script: bundle exec rubocop
17
- rvm: "2.5"
7
+ - rvm: 2.1
8
+ gemfile: gems/rails3.gemfile
9
+ - rvm: 2.2
10
+ - rvm: 2.3
11
+ - rvm: 2.4
12
+ - rvm: 2.5
13
+ - rvm: 2.6
14
+ - rvm: 2.6
15
+ gemfile: gems/octoshark.gemfile
16
+ - rvm: 2.6
17
+ name: rubocop yo
18
+ script: bundle exec rubocop
19
+ - rvm: 2.6
20
+ gemfile: gems/rails3.gemfile
@@ -1,6 +1,126 @@
1
- # 3.0.0
1
+ # 4.0.0
2
2
 
3
- * ScoutProf BETA
3
+ * Require Ruby >= 2.1 (#270)
4
+ * ErrorService reporting. Enable with `errors_enabled` config setting. (#347)
5
+ * Modular SlowRequestPolicy (#364)
6
+ * Fix deprecation warnings (#354)
7
+
8
+ # 2.6.10
9
+
10
+ * Fix an edge case in JSON serialization (#360)
11
+
12
+ # 2.6.9
13
+
14
+ * Add `ssl_cert_file` config option (#352)
15
+ * Improve sanitization of Postgres UPDATE SQL (#351)
16
+ * Allow custom URL sanitization (#341)
17
+
18
+ # 2.6.8
19
+
20
+ * Lock rake version for 1.8.7 to older version (#329)
21
+ * Delete unneeded .DS_Store file that snuck in (#334)
22
+ * Fix typo in "queue_time_ms"
23
+ * Fix Rails 6 deprecation warning at boot time (#337)
24
+ * Fix partial naming on Rails 6.0 (#339)
25
+ * Support Sidekiq 6.1 instrumentation (#340)
26
+
27
+ # 2.6.7
28
+
29
+ * Remove accidental call to `as_json`
30
+
31
+ # 2.6.6
32
+
33
+ * Add basic support for parsing Microsoft SQLServer queries (#317)
34
+ * Refine Postgresql Sanitization with subqueries and JSON operations (#262)
35
+
36
+ # 2.6.5
37
+
38
+ * Add a tag to any requests that reach maximum number of spans (#316)
39
+ * Update testing library Mocha (#315)
40
+ * Fix case sensitivity mismatch in Job renaming (#314)
41
+ * Add support for Sneakers 2.5 (#313)
42
+ * Fix edge case with Resque instrumentation (#312)
43
+ * Fix missing source code when used with BugSnag (#308)
44
+
45
+ # 2.6.4
46
+
47
+ * Add defensive check against a nil @address in Net/HTTP instruments (#306)
48
+
49
+ # 2.6.3
50
+
51
+ * Standardize Metadata with other language agents (#302)
52
+ * Add Mongoid 7.x support (#295)
53
+ * Add HTTP::Client support (#260)
54
+
55
+ # 2.6.2
56
+
57
+ * Fix Autoinstruments logging when running without ActiveSupport (#290)
58
+ * Fix edge-case Autoinstruments syntax error (#287)
59
+ * Fix invalid syntax for running on Ruby 1.8.7
60
+
61
+ # 2.6.1
62
+
63
+ * Logging total autoinstrumented spans and the ratio of significant to total spans (#283).
64
+ * Added `autoinstruments_ignore` option (also #283).
65
+
66
+ # 2.6.0
67
+
68
+ * Autoinstruments (#247). Disabled by default. Set `auto_instruments: true` to enable.
69
+
70
+ # 2.5.3
71
+
72
+ * Add Que support (#265)
73
+ * Add Memcached support (#279)
74
+
75
+ # 2.5.2
76
+
77
+ * Don't process limited layers in detailed traces (#268)
78
+ * Fix OctoShark (and other gems which patch ActiveRecord) interaction (#217)
79
+ * Legacy [Rails 2.3 fix for as_json](https://github.com/scoutapp/scout_apm_ruby/pull/276)
80
+
81
+ # 2.5.1
82
+
83
+ * Decrease timeline trace span limit to 1,500 to address [this bug](https://github.com/scoutapp/scout_apm_ruby/issues/267).
84
+
85
+ # 2.5.0
86
+
87
+ * Added timeline traces and an associated `timeline_traces: true` config option.
88
+ * Increased timeline traces span limit to 2,500 from 500.
89
+
90
+ # 2.4.24
91
+
92
+ * Fix for prepending view instruments in the case of templates that lack a `virtual_path` (#257).
93
+
94
+ # 2.4.23
95
+
96
+ * Extend #251 to use prepend on all view instruments (#255)
97
+
98
+ # 2.4.22
99
+
100
+ * Support Rails 6.0 View Instruments (#251)
101
+ * Update documentation URLs (#236)
102
+
103
+ # 2.4.21
104
+
105
+ * App & Background Integrations only install when needed (#228)
106
+ * New Setting `collect_remote_ip`, to optionally disable automated capture of
107
+ end-user IP Address. No change to default behavior.
108
+ * Allow setting `compress_payload` option from ENV var (#234)
109
+
110
+ # 2.4.20
111
+
112
+ * `start_resque_server_instrument` option to allow disabling the WEBrick server
113
+ component in custom installation scenarios
114
+ * Allow setting `revision_sha` setting in YAML
115
+
116
+ # 2.4.19
117
+
118
+ * Fix disabled_instruments (#220)
119
+
120
+ # 2.4.18
121
+
122
+ * Add Shoryuken Support (#215)
123
+ * Add Sneakers Support (#216)
4
124
 
5
125
  # 2.4.17
6
126
 
@@ -196,7 +316,6 @@ reusing that version number to avoid confusion.
196
316
 
197
317
  * Max layaway file threshold limit
198
318
 
199
-
200
319
  # 2.1.17
201
320
 
202
321
  * Additional logging around file system usage
@@ -240,6 +359,7 @@ reusing that version number to avoid confusion.
240
359
  * Initial Delayed Job support
241
360
  * Limit max metric size of a trace to 500.
242
361
 
362
+
243
363
  # 2.1.8
244
364
 
245
365
  * Adds Git revision detection, which is reported on app load and associated with transaction traces
@@ -625,7 +745,7 @@ Big set of features getting merged in for this release.
625
745
 
626
746
  # 0.1.3
627
747
 
628
- * Adds capacity calculation via "Instance/Capacity" metric.
748
+ * Adds capacity calculation via "Instance/Capacity" metric.
629
749
  * Tweaks tracing to still count a transaction if it results in a 500 error and includes it in accumulated time.
630
750
  * Adds per-transaction error tracking (ex: Errors/Controller/widgets/index)
631
751
 
data/Gemfile CHANGED
@@ -3,10 +3,4 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in scout_apm.gemspec
4
4
  gemspec
5
5
 
6
- # Pin development dependencies more conservatively for Ruby 1.8.7
7
- if RUBY_VERSION <= "1.8.7"
8
- gem "activesupport", "~> 3.2"
9
- gem "i18n", "~> 0.6.11"
10
- gem "pry", "~> 0.9.12"
11
- gem "rake", "~> 10.5"
12
- end
6
+ gem "rake", ">= 12.3.3"
@@ -12,8 +12,8 @@ The Scout agent is engineered to do some wonderful things:
12
12
 
13
13
  * A unique focus on identifying those hard-to-investigate outliers like memory bloat, N+1s, and user-specific problems. [See an example workflow](http://scoutapp.com/newrelic-alternative).
14
14
  * [Low-overhead](http://blog.scoutapp.com/articles/2016/02/07/overhead-benchmarks-new-relic-vs-scout)
15
- * View your performance metrics during development with [DevTrace](http://help.apm.scoutapp.com/#devtrace) and in production via [server_timing](https://github.com/scoutapp/ruby_server_timing).
16
- * Production-Safe profiling of custom code via [ScoutProf](http://help.apm.scoutapp.com/#scoutprof) (BETA).
15
+ * View your performance metrics during development with [DevTrace](https://docs.scoutapm.com/#devtrace) and in production via [server_timing](https://github.com/scoutapp/ruby_server_timing).
16
+ * Production-Safe profiling of custom code via [ScoutProf](https://docs.scoutapm.com/#scoutprof) (BETA).
17
17
 
18
18
  ## Getting Started
19
19
 
@@ -25,7 +25,7 @@ Update your Gemfile
25
25
 
26
26
  bundle install
27
27
 
28
- Signup for a [Scout](https://apm.scoutapp.com) account and put the provided
28
+ Signup for a [Scout](https://scoutapm.com) account and put the provided
29
29
  config file at `RAILS_ROOT/config/scout_apm.yml`.
30
30
 
31
31
  Your config file should look like:
@@ -35,6 +35,9 @@ Your config file should look like:
35
35
  key: YOUR_APPLICATION_KEY
36
36
  monitor: true
37
37
 
38
+ test:
39
+ monitor: false
40
+
38
41
  production:
39
42
  <<: *defaults
40
43
 
@@ -55,10 +58,16 @@ gem 'scout_apm'
55
58
  SCOUT_DEV_TRACE=true rails server
56
59
  ```
57
60
 
61
+ ## How to test gem locally
62
+
63
+ * Point your gemfile at your local checkout: `gem 'scout_apm', path: '/path/to/scout_apm_ruby`
64
+ * Compile native code: `cd /path/to/scout_apm_ruby && bundle exec rake compile`
65
+
66
+
58
67
  ## Docs
59
68
 
60
69
  For the complete list of supported frameworks, Rubies, configuration options
61
- and more, see our [help site](http://help.apm.scoutapp.com/).
70
+ and more, see our [help site](https://docs.scoutapm.com/).
62
71
 
63
72
  ## Help
64
73
 
data/Rakefile CHANGED
@@ -21,5 +21,5 @@ end
21
21
  # Rake Compiler
22
22
  require 'rake/extensiontask'
23
23
  Rake::ExtensionTask.new('allocations')
24
- Rake::ExtensionTask.new('stacks')
25
24
  Rake::ExtensionTask.new('rusage')
25
+
@@ -56,6 +56,7 @@ void Init_allocations()
56
56
  mInstruments = rb_define_module_under(mScoutApm, "Instruments");
57
57
  cAllocations = rb_define_class_under(mInstruments, "Allocations", rb_cObject);
58
58
  rb_define_singleton_method(cAllocations, "count", get_allocation_count, 0);
59
+ rb_define_singleton_method(cAllocations, "count", get_allocation_count, 0);
59
60
  rb_define_const(cAllocations, "ENABLED", Qtrue);
60
61
  Init_hooks(mScoutApm);
61
62
  }
@@ -78,6 +79,7 @@ void Init_allocations()
78
79
  mInstruments = rb_define_module_under(mScoutApm, "Instruments");
79
80
  cAllocations = rb_define_class_under(mInstruments, "Allocations", rb_cObject);
80
81
  rb_define_singleton_method(cAllocations, "count", get_allocation_count, 0);
82
+ rb_define_singleton_method(cAllocations, "count", get_allocation_count, 0);
81
83
  rb_define_const(cAllocations, "ENABLED", Qfalse);
82
84
  Init_hooks(mScoutApm);
83
85
  }
@@ -0,0 +1,28 @@
1
+ # Gems
2
+
3
+ These gemfiles list specific configurations of gems that we use in travis testing.
4
+
5
+ ## Travis Matrix
6
+
7
+ ```yaml
8
+ matrix:
9
+ include:
10
+ - rvm: "1.8.7"
11
+ gemfile: gems/rails3.gemfile
12
+ ```
13
+
14
+ Using a gemfile controls the specific versions of the gems that are installed, and can be used to reproduce customer configurations for testing.
15
+
16
+ ## Local Testing
17
+
18
+ To install the gems specified by a specific gemfile:
19
+
20
+ ```
21
+ BUNDLE_GEMFILE=gems/rails5.gemfile bundle install
22
+ ```
23
+
24
+ Then, to run tests using these gems:
25
+
26
+ ```
27
+ BUNDLE_GEMFILE=gems/rails5.gemfile bundle exec rake
28
+ ```
@@ -0,0 +1,4 @@
1
+ eval_gemfile("../Gemfile")
2
+
3
+ # https://github.com/scoutapp/scout_apm_ruby/issues/217
4
+ gem 'octoshark'
@@ -0,0 +1,5 @@
1
+ eval_gemfile("../Gemfile")
2
+
3
+ gem "json", "1.8.6"
4
+ gem "rails", "~> 3.2"
5
+ gem "sqlite3", "~> 1.3.5"
@@ -0,0 +1,4 @@
1
+ eval_gemfile("../Gemfile")
2
+
3
+ gem "rails", "~> 4.2"
4
+ gem "sqlite3", "~> 1.3.6"
@@ -0,0 +1,4 @@
1
+ eval_gemfile("../Gemfile")
2
+
3
+ gem "rails", "~> 5.0"
4
+ gem "sqlite3", "~> 1.3", ">= 1.3.6"
@@ -0,0 +1,4 @@
1
+ eval_gemfile("../Gemfile")
2
+
3
+ gem "rails", "~> 6.0.0rc1"
4
+ gem "sqlite3", "~> 1.4"
@@ -15,7 +15,7 @@ require 'socket'
15
15
  require 'thread'
16
16
  require 'time'
17
17
  require 'yaml'
18
- require 'rbconfig'
18
+ require 'securerandom'
19
19
 
20
20
  #####################################
21
21
  # Gem Requires
@@ -45,6 +45,7 @@ require 'scout_apm/layer_converters/database_converter'
45
45
  require 'scout_apm/layer_converters/slow_request_converter'
46
46
  require 'scout_apm/layer_converters/request_queue_time_converter'
47
47
  require 'scout_apm/layer_converters/allocation_metric_converter'
48
+ require 'scout_apm/layer_converters/trace_converter'
48
49
  require 'scout_apm/layer_converters/histograms'
49
50
  require 'scout_apm/layer_converters/find_layer_by_type'
50
51
 
@@ -59,6 +60,10 @@ require 'scout_apm/server_integrations/null'
59
60
  require 'scout_apm/background_job_integrations/sidekiq'
60
61
  require 'scout_apm/background_job_integrations/delayed_job'
61
62
  require 'scout_apm/background_job_integrations/resque'
63
+ require 'scout_apm/background_job_integrations/shoryuken'
64
+ require 'scout_apm/background_job_integrations/sneakers'
65
+ require 'scout_apm/background_job_integrations/que'
66
+ require 'scout_apm/background_job_integrations/legacy_sneakers'
62
67
 
63
68
  require 'scout_apm/framework_integrations/rails_2'
64
69
  require 'scout_apm/framework_integrations/rails_3_or_4'
@@ -75,6 +80,7 @@ require 'scout_apm/instruments/net_http'
75
80
  require 'scout_apm/instruments/http_client'
76
81
  require 'scout_apm/instruments/moped'
77
82
  require 'scout_apm/instruments/mongoid'
83
+ require 'scout_apm/instruments/memcached'
78
84
  require 'scout_apm/instruments/redis'
79
85
  require 'scout_apm/instruments/influxdb'
80
86
  require 'scout_apm/instruments/elasticsearch'
@@ -94,12 +100,6 @@ require 'scout_apm/instruments/process/process_memory'
94
100
  require 'scout_apm/instruments/percentile_sampler'
95
101
  require 'scout_apm/instruments/samplers'
96
102
 
97
- begin
98
- require 'stacks'
99
- rescue LoadError
100
- require 'scout_apm/utils/fake_stacks'
101
- end
102
-
103
103
  require 'scout_apm/app_server_load'
104
104
 
105
105
  require 'scout_apm/ignored_uris.rb'
@@ -113,6 +113,7 @@ require 'scout_apm/utils/time'
113
113
  require 'scout_apm/utils/unique_id'
114
114
  require 'scout_apm/utils/numbers'
115
115
  require 'scout_apm/utils/gzip_helper'
116
+ require 'scout_apm/utils/marshal_logging'
116
117
 
117
118
  require 'scout_apm/config'
118
119
  require 'scout_apm/environment'
@@ -133,7 +134,6 @@ require 'scout_apm/tracer'
133
134
  require 'scout_apm/transaction'
134
135
  require 'scout_apm/context'
135
136
  require 'scout_apm/instant_reporting'
136
- require 'scout_apm/trace_compactor'
137
137
  require 'scout_apm/background_recorder'
138
138
  require 'scout_apm/synchronous_recorder'
139
139
 
@@ -142,9 +142,15 @@ require 'scout_apm/metric_stats'
142
142
  require 'scout_apm/db_query_metric_stats'
143
143
  require 'scout_apm/slow_transaction'
144
144
  require 'scout_apm/slow_job_record'
145
+ require 'scout_apm/detailed_trace'
145
146
  require 'scout_apm/scored_item_set'
147
+
146
148
  require 'scout_apm/slow_request_policy'
147
- require 'scout_apm/slow_job_policy'
149
+ require 'scout_apm/slow_policy/age_policy'
150
+ require 'scout_apm/slow_policy/speed_policy'
151
+ require 'scout_apm/slow_policy/percent_policy'
152
+ require 'scout_apm/slow_policy/percentile_policy'
153
+
148
154
  require 'scout_apm/job_record'
149
155
  require 'scout_apm/request_histograms'
150
156
  require 'scout_apm/transaction_time_consumed'
@@ -185,6 +191,16 @@ require 'scout_apm/tasks/support'
185
191
  require 'scout_apm/extensions/config'
186
192
  require 'scout_apm/extensions/transaction_callback_payload'
187
193
 
194
+ require 'scout_apm/error_service'
195
+ require 'scout_apm/error_service/middleware'
196
+ require 'scout_apm/error_service/notifier'
197
+ require 'scout_apm/error_service/sidekiq'
198
+ require 'scout_apm/error_service/ignored_exceptions'
199
+ require 'scout_apm/error_service/error_buffer'
200
+ require 'scout_apm/error_service/error_record'
201
+ require 'scout_apm/error_service/periodic_work'
202
+ require 'scout_apm/error_service/payload'
203
+
188
204
  if defined?(Rails) && defined?(Rails::VERSION) && defined?(Rails::VERSION::MAJOR) && Rails::VERSION::MAJOR >= 3 && defined?(Rails::Railtie)
189
205
  module ScoutApm
190
206
  class Railtie < Rails::Railtie
@@ -197,6 +213,18 @@ if defined?(Rails) && defined?(Rails::VERSION) && defined?(Rails::VERSION::MAJOR
197
213
  # Attempt to start right away, this will work best for preloading apps, Unicorn & Puma & similar
198
214
  ScoutApm::Agent.instance.install
199
215
 
216
+ if ScoutApm::Agent.instance.context.config.value("auto_instruments")
217
+ ScoutApm::Agent.instance.context.logger.debug("AutoInstruments is enabled.")
218
+ require 'scout_apm/auto_instrument'
219
+ else
220
+ ScoutApm::Agent.instance.context.logger.debug("AutoInstruments is disabled.")
221
+ end
222
+
223
+ if ScoutApm::Agent.instance.context.config.value("errors_enabled")
224
+ app.config.middleware.insert_after ActionDispatch::DebugExceptions, ScoutApm::ErrorService::Middleware
225
+ ScoutApm::ErrorService::Sidekiq.new.install
226
+ end
227
+
200
228
  # Install the middleware every time in development mode.
201
229
  # The middleware is a noop if dev_trace is not enabled in config
202
230
  if Rails.env.development?