scout_apm 2.1.30 → 2.1.31

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94cee593281d02b80d99aa3bf55a66fb4ef1adf9
4
- data.tar.gz: a5aff2d47256429910ff7eb2e4f0c145bdca69f7
3
+ metadata.gz: eb46c36dc0f4c1ccda7a499e8f24b3a169b18f96
4
+ data.tar.gz: 931412d8a6a6fda9f07e3b996414da0670590e1a
5
5
  SHA512:
6
- metadata.gz: 4a38d11380c58574636bf7ed6e086f890989edd7e7ef5a395e4d9cfecd11dc12c30206a85ea4f25324b28c4d92e49cad7be3e2e0ccd332a75f93497cc03b96d8
7
- data.tar.gz: dd758e13ce68396da594a7d6bc8a04dc9f3f300d7bda905cb3676ca36a74b347ea9ace9f818b652b92150dfdb85d23656ad802c713660098f095b14d8ab88c11
6
+ metadata.gz: e496c29a689f6b651766f219c4e89b42bf7b105c270601f101e3790a53df2eba8e1cfb43df0c4d54f3faffff7c195819307d97bdabe49740e454c6eff1fc7dd4
7
+ data.tar.gz: ff5fd16fc53b58e2bb9a9dfd4198a56428e197f7a3b49c463acbc66ef1f6d2ff96cc2f630244165c143e55293f9bf0811c3dda58c55d2c01f89158425ed346a7
@@ -1,3 +1,9 @@
1
+ # 2.1.31
2
+
3
+ * Better detection of Resque queue names
4
+ * Fix passing arguments through Active Record instrumentation. (Thanks to Nick Quaranto for providing the fix)
5
+ * Stricter checks to prevent agent from starting in Rails console
6
+
1
7
  # 2.1.30
2
8
 
3
9
  * Add Resque support.
@@ -89,6 +89,11 @@ module ScoutApm
89
89
  return false unless force?
90
90
  end
91
91
 
92
+ if environment.interactive?
93
+ logger.warn "Agent attempting to load in interactive mode. #{force? ? 'Forcing agent to start' : 'Not starting agent'}"
94
+ return false unless force?
95
+ end
96
+
92
97
  if app_server_missing?(options) && background_job_missing?
93
98
  if force?
94
99
  logger.warn "Agent starting (forced)"
@@ -36,12 +36,6 @@ module ScoutApm
36
36
 
37
37
  loop do
38
38
  begin
39
- # Bail out if @keep_running is false
40
- unless @keep_running
41
- ScoutApm::Agent.instance.logger.debug "Background Worker: breaking from loop"
42
- break
43
- end
44
-
45
39
  now = Time.now
46
40
 
47
41
  # Sleep the correct amount of time to reach next_time
@@ -51,6 +45,12 @@ module ScoutApm
51
45
  now = Time.now
52
46
  end
53
47
 
48
+ # Bail out if @keep_running is false
49
+ unless @keep_running
50
+ ScoutApm::Agent.instance.logger.debug "Background Worker: breaking from loop"
51
+ break
52
+ end
53
+
54
54
  @task.call
55
55
 
56
56
  # Adjust the next time to run forward by @periods until it is in the future
@@ -153,6 +153,11 @@ module ScoutApm
153
153
  background_job_integration && background_job_integration.name
154
154
  end
155
155
 
156
+ # If both stdin & stdout are interactive and the Rails::Console constant is defined
157
+ def interactive?
158
+ defined?(::Rails::Console) && $stdout.isatty && $stdin.isatty
159
+ end
160
+
156
161
  ### ruby checks
157
162
 
158
163
  def rubinius?
@@ -122,7 +122,7 @@ module ScoutApm
122
122
  current_layer.desc = desc
123
123
  end
124
124
 
125
- log_without_scout_instruments(sql, name, &block)
125
+ log_without_scout_instruments(*args, &block)
126
126
 
127
127
  # OR: Start a new layer, we didn't pick up instrumentation earlier in the stack.
128
128
  else
@@ -130,7 +130,7 @@ module ScoutApm
130
130
  layer.desc = desc
131
131
  req.start_layer(layer)
132
132
  begin
133
- log_without_scout_instruments(sql, name, &block)
133
+ log_without_scout_instruments(*args, &block)
134
134
  ensure
135
135
  req.stop_layer
136
136
  end
@@ -3,11 +3,10 @@ module ScoutApm
3
3
  module Resque
4
4
  def around_perform_with_scout_instruments(*args)
5
5
  job_name = self.to_s
6
- queue = @queue
6
+ queue = find_queue
7
7
 
8
8
  req = ScoutApm::RequestManager.lookup
9
9
  req.job!
10
- # req.annotate_request(:queue_latency => latency(msg))
11
10
 
12
11
  begin
13
12
  req.start_layer(ScoutApm::Layer.new('Queue', queue))
@@ -24,6 +23,12 @@ module ScoutApm
24
23
  req.stop_layer if started_queue
25
24
  end
26
25
  end
26
+
27
+ def find_queue
28
+ return @queue if @queue
29
+ return queue if self.respond_to?(:queue)
30
+ return "unknown"
31
+ end
27
32
  end
28
33
  end
29
34
  end
@@ -1,4 +1,4 @@
1
1
  module ScoutApm
2
- VERSION = "2.1.30"
2
+ VERSION = "2.1.31"
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.1.30
4
+ version: 2.1.31
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: 2017-08-15 00:00:00.000000000 Z
12
+ date: 2017-09-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest