scout_apm 3.0.0.pre7 → 3.0.0.pre8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +5 -0
- data/lib/scout_apm/agent.rb +2 -0
- data/lib/scout_apm/background_job_integrations/delayed_job.rb +16 -2
- data/lib/scout_apm/config.rb +30 -1
- data/lib/scout_apm/version.rb +1 -1
- data/test/unit/config_test.rb +1 -1
- metadata +30 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63c9b4319eecbefb59fdb10fb0fbc0d264dfb7a0
|
4
|
+
data.tar.gz: 821271be9ef95416e72b659a825895513d80017d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 330d8721be955d8676285665d7db211919b1867da0720b1b24c663119f434cb7aaffa9a55cec27d8286633d40d924b337283fea0c45195d872900f54a3c6c041
|
7
|
+
data.tar.gz: 0eef9b024471d03e689aaceffd56402c32a5f0904e6c9124209bb60e4d06173f281fc25b3562225303b5c8292be7daab2f5233618a098454c646da597d4913fa
|
data/CHANGELOG.markdown
CHANGED
data/lib/scout_apm/agent.rb
CHANGED
@@ -118,6 +118,8 @@ module ScoutApm
|
|
118
118
|
init_logger
|
119
119
|
logger.info "Attempting to start Scout Agent [#{ScoutApm::VERSION}] on [#{environment.hostname}]"
|
120
120
|
|
121
|
+
@config.log_settings
|
122
|
+
|
121
123
|
@ignored_uris = ScoutApm::IgnoredUris.new(config.value('ignore'))
|
122
124
|
|
123
125
|
load_instruments if should_load_instruments?(options)
|
@@ -2,6 +2,7 @@ module ScoutApm
|
|
2
2
|
module BackgroundJobIntegrations
|
3
3
|
class DelayedJob
|
4
4
|
ACTIVE_JOB_KLASS = 'ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper'.freeze
|
5
|
+
DJ_PERFORMABLE_METHOD = 'Delayed::PerformableMethod'.freeze
|
5
6
|
|
6
7
|
attr_reader :logger
|
7
8
|
|
@@ -26,14 +27,27 @@ module ScoutApm
|
|
26
27
|
ScoutApm::Agent.instance.start_background_worker unless ScoutApm::Agent.instance.background_worker_running?
|
27
28
|
|
28
29
|
name = begin
|
29
|
-
|
30
|
+
case job.payload_object.class.to_s
|
31
|
+
|
32
|
+
# ActiveJob's class wraps the actual job class
|
33
|
+
when ACTIVE_JOB_KLASS
|
30
34
|
job.payload_object.job_data["job_class"]
|
31
|
-
|
35
|
+
|
36
|
+
# An adhoc job, called like `@user.delay.fib(10)`.
|
37
|
+
# returns a string like "User#fib"
|
38
|
+
when DJ_PERFORMABLE_METHOD
|
32
39
|
job.name
|
40
|
+
|
41
|
+
# A "real" job called like `Delayed::Job.enqueue(MyJob.new)`
|
42
|
+
# returns "MyJob"
|
43
|
+
else
|
44
|
+
job.payload_object.class.to_s
|
33
45
|
end
|
34
46
|
rescue
|
47
|
+
# Fall back to whatever DJ thinks the name is.
|
35
48
|
job.name
|
36
49
|
end
|
50
|
+
|
37
51
|
queue = job.queue || "default"
|
38
52
|
|
39
53
|
req = ScoutApm::RequestManager.lookup
|
data/lib/scout_apm/config.rb
CHANGED
@@ -165,12 +165,17 @@ module ScoutApm
|
|
165
165
|
@overlays = Array(overlays)
|
166
166
|
end
|
167
167
|
|
168
|
+
# For a given key, what is the first overlay says that it can handle it?
|
169
|
+
def overlay_for_key(key)
|
170
|
+
@overlays.detect{ |overlay| overlay.has_key?(key) }
|
171
|
+
end
|
172
|
+
|
168
173
|
def value(key)
|
169
174
|
if ! KNOWN_CONFIG_OPTIONS.include?(key)
|
170
175
|
ScoutApm::Agent.instance.logger.debug("Requested looking up a unknown configuration key: #{key} (not a problem. Evaluate and add to config.rb)")
|
171
176
|
end
|
172
177
|
|
173
|
-
o =
|
178
|
+
o = overlay_for_key(key)
|
174
179
|
raw_value = if o
|
175
180
|
o.value(key)
|
176
181
|
else
|
@@ -187,6 +192,14 @@ module ScoutApm
|
|
187
192
|
@overlays.any? { |overlay| overlay.any_keys_found? }
|
188
193
|
end
|
189
194
|
|
195
|
+
def log_settings
|
196
|
+
messages = KNOWN_CONFIG_OPTIONS.inject([]) do |memo, key|
|
197
|
+
o = overlay_for_key(key)
|
198
|
+
memo << "#{o.name} - #{key}: #{value(key).inspect}"
|
199
|
+
end
|
200
|
+
ScoutApm::Agent.instance.logger.debug("Resolved Setting Values:\n" + messages.join("\n"))
|
201
|
+
end
|
202
|
+
|
190
203
|
class ConfigDefaults
|
191
204
|
DEFAULTS = {
|
192
205
|
'compress_payload' => true,
|
@@ -214,6 +227,10 @@ module ScoutApm
|
|
214
227
|
def any_keys_found?
|
215
228
|
false
|
216
229
|
end
|
230
|
+
|
231
|
+
def name
|
232
|
+
"defaults"
|
233
|
+
end
|
217
234
|
end
|
218
235
|
|
219
236
|
|
@@ -232,6 +249,10 @@ module ScoutApm
|
|
232
249
|
def any_keys_found?
|
233
250
|
false
|
234
251
|
end
|
252
|
+
|
253
|
+
def name
|
254
|
+
"no-config"
|
255
|
+
end
|
235
256
|
end
|
236
257
|
|
237
258
|
class ConfigEnvironment
|
@@ -253,6 +274,10 @@ module ScoutApm
|
|
253
274
|
ENV.has_key?(key_to_env_key(option))
|
254
275
|
}
|
255
276
|
end
|
277
|
+
|
278
|
+
def name
|
279
|
+
"environment"
|
280
|
+
end
|
256
281
|
end
|
257
282
|
|
258
283
|
# Attempts to load a configuration file, and parse it as YAML. If the file
|
@@ -284,6 +309,10 @@ module ScoutApm
|
|
284
309
|
}
|
285
310
|
end
|
286
311
|
|
312
|
+
def name
|
313
|
+
"config-file"
|
314
|
+
end
|
315
|
+
|
287
316
|
private
|
288
317
|
|
289
318
|
def load_file(file)
|
data/lib/scout_apm/version.rb
CHANGED
data/test/unit/config_test.rb
CHANGED
@@ -32,7 +32,7 @@ class ConfigTest < Minitest::Test
|
|
32
32
|
conf = ScoutApm::Config.with_file(conf_file, environment: "staging")
|
33
33
|
|
34
34
|
assert_equal "info", conf.value('log_level') # the default value
|
35
|
-
|
35
|
+
assert_nil nil, conf.value('name') # the default value
|
36
36
|
end
|
37
37
|
|
38
38
|
def test_boolean_coercion
|
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: 3.0.0.
|
4
|
+
version: 3.0.0.pre8
|
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: 2016-12-
|
12
|
+
date: 2016-12-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
@@ -292,8 +292,34 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
292
292
|
version: 1.3.1
|
293
293
|
requirements: []
|
294
294
|
rubyforge_project: scout_apm
|
295
|
-
rubygems_version: 2.
|
295
|
+
rubygems_version: 2.5.2
|
296
296
|
signing_key:
|
297
297
|
specification_version: 4
|
298
298
|
summary: Ruby application performance monitoring
|
299
|
-
test_files:
|
299
|
+
test_files:
|
300
|
+
- test/data/config_test_1.yml
|
301
|
+
- test/test_helper.rb
|
302
|
+
- test/unit/agent_test.rb
|
303
|
+
- test/unit/background_job_integrations/sidekiq_test.rb
|
304
|
+
- test/unit/config_test.rb
|
305
|
+
- test/unit/context_test.rb
|
306
|
+
- test/unit/environment_test.rb
|
307
|
+
- test/unit/git_revision_test.rb
|
308
|
+
- test/unit/histogram_test.rb
|
309
|
+
- test/unit/ignored_uris_test.rb
|
310
|
+
- test/unit/instruments/active_record_instruments_test.rb
|
311
|
+
- test/unit/instruments/net_http_test.rb
|
312
|
+
- test/unit/instruments/percentile_sampler_test.rb
|
313
|
+
- test/unit/layaway_test.rb
|
314
|
+
- test/unit/layer_children_set_test.rb
|
315
|
+
- test/unit/limited_layer_test.rb
|
316
|
+
- test/unit/metric_set_test.rb
|
317
|
+
- test/unit/scored_item_set_test.rb
|
318
|
+
- test/unit/serializers/payload_serializer_test.rb
|
319
|
+
- test/unit/slow_job_policy_test.rb
|
320
|
+
- test/unit/slow_request_policy_test.rb
|
321
|
+
- test/unit/sql_sanitizer_test.rb
|
322
|
+
- test/unit/store_test.rb
|
323
|
+
- test/unit/utils/active_record_metric_name_test.rb
|
324
|
+
- test/unit/utils/backtrace_parser_test.rb
|
325
|
+
- test/unit/utils/numbers_test.rb
|