scout_apm 2.4.3 → 2.4.4

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: 9b8e456f2a8aa317fd9b2c6fdcbdd0b1fe5a5609
4
- data.tar.gz: 5cff8d270a43db7458ccc0e3cb1ce69b9080f30d
3
+ metadata.gz: f9ba2d44228de2ea17e70a87425b7e7a3d6ebc34
4
+ data.tar.gz: ebf97e1ddd39bfeefc70a5d559b8040e3f7f5657
5
5
  SHA512:
6
- metadata.gz: b64cc8052ef1a8aa7a23873f4c554bebedab4c33ec94f6c5cb1b76e918ba0c95e5d015666e95d3a1efe4bf658e0e652f0ca8390ebee949fb66e1b5cb0b280e73
7
- data.tar.gz: feea8fc217559d5aad2ee4e53727f300bb50b37f515b2c97ec120be029014cb51b3890179681c6e7833045150a06512b3ac0e950f2fab2cb6cc78ee7d996e133
6
+ metadata.gz: f00ff64d371bcf47ba2cd5cf19f2b6c3091c2b6b1f5fefd8f82e2354490295750e155fc88165e2357ddc8110d396420e4e04374589687ea50a878797c411ec0b
7
+ data.tar.gz: 4c0e9ab6e524a65c94e97b4860e843945c55e4fca30c4870325b83a6747a9eb057342da9abc8ec6c8bab3920077aaea178c687261d2676ef79d6c07de74e48ea
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,9 @@
1
+ # 2.4.4
2
+
3
+ * Prevent agent from starting when monitor=false
4
+ * Fix double-counting of HTTP requests when multiple http libraries are present
5
+ * Fix an issue with Resque instrumentation
6
+
1
7
  # 2.4.3
2
8
 
3
9
  * Ensure a startup hook runs on forking webservers
@@ -22,7 +22,12 @@ module ScoutApm
22
22
 
23
23
  PRECONDITION_DETECTED_SERVER = {
24
24
  :message => proc {|environ| "Deferring agent start. Standing by for first request" },
25
- :check => proc { |context| !app_server_missing?(context) && !background_job_missing?(context) },
25
+ :check => proc { |context|
26
+ app_server_missing = !context.environment.app_server_integration(true).found?
27
+ background_job_missing = context.environment.background_job_integrations.length == 0
28
+
29
+ !app_server_missing && !background_job_missing
30
+ },
26
31
  },
27
32
 
28
33
  PRECONDITION_ALREADY_STARTED = {
@@ -36,34 +41,29 @@ module ScoutApm
36
41
  },
37
42
  ]
38
43
 
39
- def self.check?(context)
40
- failed_preconditions = PRECONDITIONS.inject(Array.new) { |errors, condition|
41
- met = condition[:check].call(context)
42
- errors << condition[:message].call(context.environment) unless met
43
- errors
44
- }
44
+ def check?(context)
45
+ @check_result ||=
46
+ begin
47
+ failed_preconditions = PRECONDITIONS.inject(Array.new) { |errors, condition|
48
+ met = condition[:check].call(context)
49
+ errors << condition[:message].call(context.environment) unless met
50
+ errors
51
+ }
45
52
 
46
- if failed_preconditions.any?
47
- failed_preconditions.each {|msg| context.logger.warn(msg) }
48
- force? # if forced, return true anyway
49
- else
50
- # No errors, we met preconditions
51
- true
52
- end
53
+ if failed_preconditions.any?
54
+ failed_preconditions.each {|msg| context.logger.warn(msg) }
55
+ force? # if forced, return true anyway
56
+ else
57
+ # No errors, we met preconditions
58
+ true
59
+ end
60
+ end
53
61
  end
54
62
 
55
63
  # XXX: Wire up options here and below in the appserver & bg server detections
56
- def self.force?
64
+ def force?
57
65
  false
58
66
  end
59
-
60
- def self.app_server_missing?(context)
61
- !context.environment.app_server_integration(true).found? # && !options[:skip_app_server_check]
62
- end
63
-
64
- def self.background_job_missing?(context)
65
- context.environment.background_job_integrations.length == 0
66
- end
67
67
  end
68
68
  end
69
69
  end
@@ -47,7 +47,8 @@ module ScoutApm
47
47
 
48
48
  context.installed!
49
49
 
50
- if ScoutApm::Agent::Preconditions.check?(context) || force
50
+ @preconditions = ScoutApm::Agent::Preconditions.new
51
+ if @preconditions.check?(context) || force
51
52
  start
52
53
  end
53
54
  end
@@ -55,8 +56,12 @@ module ScoutApm
55
56
  # Unconditionally starts the agent. This includes verifying instruments are
56
57
  # installed, and starting the background worker.
57
58
  #
58
- # Does not attempt to start twice.
59
- def start(_opts={})
59
+ # The monitor precondition is checked explicitly, and we will *never* start with monitor = false
60
+ #
61
+ # This does not attempt to start twice
62
+ def start(opts={})
63
+ return unless context.config.value('monitor')
64
+
60
65
  if context.started?
61
66
  start_background_worker unless background_worker_running?
62
67
  return
@@ -52,8 +52,8 @@ module ScoutApm
52
52
  # expected to have its accepting webserver up and running
53
53
  def become_remote_client!(host, port)
54
54
  logger.debug("Becoming Remote Agent (reporting to: #{host}:#{port})")
55
- recorder = ScoutApm::Remote::Recorder.new(host, port, logger)
56
- store = ScoutApm::FakeStore.new
55
+ @recorder = ScoutApm::Remote::Recorder.new(host, port, logger)
56
+ @store = ScoutApm::FakeStore.new
57
57
  end
58
58
 
59
59
 
@@ -26,7 +26,7 @@ module ScoutApm
26
26
  include ScoutApm::Tracer
27
27
 
28
28
  def request_with_scout_instruments(*args,&block)
29
- self.class.instrument("HTTP", "request", :desc => request_scout_description(args.first)) do
29
+ self.class.instrument("HTTP", "request", :ignore_children => true, :desc => request_scout_description(args.first)) do
30
30
  request_without_scout_instruments(*args, &block)
31
31
  end
32
32
  end
@@ -41,7 +41,7 @@ module ScoutApm
41
41
 
42
42
  logger.debug("Remote: Server returned after #start call, thread exiting")
43
43
  rescue => e
44
- logger.debug("Remote: Server Exception, #{e}")
44
+ logger.debug("Remote: Server Exception, #{e},\n#{e.backtrace.join("\n\t")}")
45
45
  end
46
46
  end
47
47
  end
@@ -1,4 +1,4 @@
1
1
  module ScoutApm
2
- VERSION = "2.4.3"
2
+ VERSION = "2.4.4"
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.3
4
+ version: 2.4.4
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-01-17 00:00:00.000000000 Z
12
+ date: 2018-01-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest