scout_apm 2.4.3 → 2.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +6 -0
- data/lib/scout_apm/agent/preconditions.rb +23 -23
- data/lib/scout_apm/agent.rb +8 -3
- data/lib/scout_apm/agent_context.rb +2 -2
- data/lib/scout_apm/instruments/net_http.rb +1 -1
- data/lib/scout_apm/remote/server.rb +1 -1
- data/lib/scout_apm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9ba2d44228de2ea17e70a87425b7e7a3d6ebc34
|
4
|
+
data.tar.gz: ebf97e1ddd39bfeefc70a5d559b8040e3f7f5657
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f00ff64d371bcf47ba2cd5cf19f2b6c3091c2b6b1f5fefd8f82e2354490295750e155fc88165e2357ddc8110d396420e4e04374589687ea50a878797c411ec0b
|
7
|
+
data.tar.gz: 4c0e9ab6e524a65c94e97b4860e843945c55e4fca30c4870325b83a6747a9eb057342da9abc8ec6c8bab3920077aaea178c687261d2676ef79d6c07de74e48ea
|
data/CHANGELOG.markdown
CHANGED
@@ -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|
|
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
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
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
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
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
|
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
|
data/lib/scout_apm/agent.rb
CHANGED
@@ -47,7 +47,8 @@ module ScoutApm
|
|
47
47
|
|
48
48
|
context.installed!
|
49
49
|
|
50
|
-
|
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
|
-
#
|
59
|
-
|
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
|
data/lib/scout_apm/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2018-01-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|