scout_apm 2.4.20 → 2.4.21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3410254ae73b93df713b64fd10fc4e913e9ac8be
4
- data.tar.gz: aa5bcf808cc4a7190d8d6597f1b1ae92fc0a77a3
3
+ metadata.gz: 7414d9bde0f829ed4cfc7975c5bdca2e5cda5910
4
+ data.tar.gz: 6a0ab71bfa23362adefb328f69a887bae5551b6b
5
5
  SHA512:
6
- metadata.gz: d2144aa3b55a6ff69d22cdae53a88fb4eeb8d56040606ddf9cb4421cc6b802d7604004d04bcdd64242460c8c37174e730d118c632cf37a1965e4bf0a862b7a67
7
- data.tar.gz: 2f79898f6ab830d10c8f6c783e987e47d2a8caa80d5e8b3ae98336372b4cec6abf8a1a9a70b2ac16800ce530ce04b318e3db783f1481fe5439c2a03e69e77584
6
+ metadata.gz: 99e1906e5273202785cbd6c75acc4a833887f1a27240e7763b16d7296d1b4ba30a080729b67214372de08170c06541869b94c0d825726822be305ab05d12651b
7
+ data.tar.gz: 8f44f8874f66b75ac8e1146678a7c91964661422b9e3386eccc0bca115269d9874403dc042cfc771da48552636a23e33c219a0648400615e8fbbf49027117b86
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,10 @@
1
+ # 2.4.21
2
+
3
+ * App & Background Integrations only install when needed (#228)
4
+ * New Setting `collect_remote_ip`, to optionally disable automated capture of
5
+ end-user IP Address. No change to default behavior.
6
+ * Allow setting `compress_payload` option from ENV var (#234)
7
+
1
8
  # 2.4.20
2
9
 
3
10
  * `start_resque_server_instrument` option to allow disabling the WEBrick server
data/README.markdown CHANGED
@@ -55,6 +55,12 @@ gem 'scout_apm'
55
55
  SCOUT_DEV_TRACE=true rails server
56
56
  ```
57
57
 
58
+ ## How to test gem locally
59
+
60
+ * Point your gemfile at your local checkout: `gem 'scout_apm', path: '/path/to/scout_apm_ruby`
61
+ * Compile native code: `cd /path/to/scout_apm_ruby && bundle exec rake compile`
62
+
63
+
58
64
  ## Docs
59
65
 
60
66
  For the complete list of supported frameworks, Rubies, configuration options
@@ -37,10 +37,13 @@ module ScoutApm
37
37
 
38
38
  logger.info "Scout Agent [#{ScoutApm::VERSION}] Initialized"
39
39
 
40
- instrument_manager.install! if should_load_instruments? || force
41
-
42
- install_background_job_integrations
43
- install_app_server_integration
40
+ if should_load_instruments? || force
41
+ instrument_manager.install!
42
+ install_background_job_integrations
43
+ install_app_server_integration
44
+ else
45
+ logger.info "Not Loading Instruments"
46
+ end
44
47
 
45
48
  logger.info "Scout Agent [#{ScoutApm::VERSION}] Installed"
46
49
 
@@ -10,6 +10,7 @@ require 'scout_apm/environment'
10
10
  # customer-focused documentation.
11
11
  #
12
12
  # application_root - override the detected directory of the application
13
+ # collect_remote_ip - automatically capture user's IP into a Trace's Context
13
14
  # compress_payload - true/false to enable gzipping of payload
14
15
  # data_file - override the default temporary storage location. Must be a location in a writable directory
15
16
  # dev_trace - true or false. Enables always-on tracing in development environmen only
@@ -40,6 +41,7 @@ module ScoutApm
40
41
  KNOWN_CONFIG_OPTIONS = [
41
42
  'application_root',
42
43
  'async_recording',
44
+ 'collect_remote_ip',
43
45
  'compress_payload',
44
46
  'config_file',
45
47
  'data_file',
@@ -151,13 +153,15 @@ module ScoutApm
151
153
 
152
154
 
153
155
  SETTING_COERCIONS = {
154
- "async_recording" => BooleanCoercion.new,
155
- "detailed_middleware" => BooleanCoercion.new,
156
- "dev_trace" => BooleanCoercion.new,
157
- "enable_background_jobs" => BooleanCoercion.new,
158
- "ignore" => JsonCoercion.new,
159
- "max_traces" => IntegerCoercion.new,
160
- "monitor" => BooleanCoercion.new,
156
+ 'async_recording' => BooleanCoercion.new,
157
+ 'detailed_middleware' => BooleanCoercion.new,
158
+ 'dev_trace' => BooleanCoercion.new,
159
+ 'enable_background_jobs' => BooleanCoercion.new,
160
+ 'ignore' => JsonCoercion.new,
161
+ 'max_traces' => IntegerCoercion.new,
162
+ 'monitor' => BooleanCoercion.new,
163
+ 'collect_remote_ip' => BooleanCoercion.new,
164
+ 'compress_payload' => BooleanCoercion.new,
161
165
  'database_metric_limit' => IntegerCoercion.new,
162
166
  'database_metric_report_limit' => IntegerCoercion.new,
163
167
  'instrument_http_url_length' => IntegerCoercion.new,
@@ -268,6 +272,7 @@ module ScoutApm
268
272
  'database_metric_report_limit' => 1000,
269
273
  'instrument_http_url_length' => 300,
270
274
  'start_resque_server_instrument' => true, # still only starts if Resque is detected
275
+ 'collect_remote_ip' => true,
271
276
  }.freeze
272
277
 
273
278
  def value(key)
@@ -54,7 +54,9 @@ module ScoutApm
54
54
  def perform_action_with_scout_instruments(*args, &block)
55
55
  req = ScoutApm::RequestManager.lookup
56
56
  req.annotate_request(:uri => request.path) # for security by-default, we don't use request.fullpath which could reveal filtered params.
57
- req.context.add_user(:ip => request.remote_ip)
57
+ if ScoutApm::Agent.instance.context.config.value('collect_remote_ip')
58
+ req.context.add_user(:ip => request.remote_ip)
59
+ end
58
60
  req.set_headers(request.headers)
59
61
  req.start_layer( ScoutApm::Layer.new("Controller", "#{controller_path}/#{action_name}") )
60
62
 
@@ -60,10 +60,11 @@ module ScoutApm
60
60
  def process_action(*args)
61
61
  req = ScoutApm::RequestManager.lookup
62
62
  current_layer = req.current_layer
63
+ agent_context = ScoutApm::Agent.instance.context
63
64
 
64
65
  # Check if this this request is to be reported instantly
65
66
  if instant_key = request.cookies['scoutapminstant']
66
- ScoutApm::Agent.instance.context.logger.info "Instant trace request with key=#{instant_key} for path=#{path}"
67
+ agent_context.logger.info "Instant trace request with key=#{instant_key} for path=#{path}"
67
68
  req.instant_key = instant_key
68
69
  end
69
70
 
@@ -74,7 +75,9 @@ module ScoutApm
74
75
  req.annotate_request(:uri => ScoutApm::Instruments::ActionControllerRails3Rails4.scout_transaction_uri(request))
75
76
 
76
77
  # IP Spoofing Protection can throw an exception, just move on w/o remote ip
77
- req.context.add_user(:ip => request.remote_ip) rescue nil
78
+ if agent_context.config.value('collect_remote_ip')
79
+ req.context.add_user(:ip => request.remote_ip) rescue nil
80
+ end
78
81
  req.set_headers(request.headers)
79
82
 
80
83
  resolved_name = scout_action_name(*args)
@@ -1,4 +1,4 @@
1
1
  module ScoutApm
2
- VERSION = "2.4.20"
2
+ VERSION = "2.4.21"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.20
4
+ version: 2.4.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Haynes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-10-22 00:00:00.000000000 Z
12
+ date: 2018-11-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest