scout_apm 2.1.31 → 2.1.32

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: eb46c36dc0f4c1ccda7a499e8f24b3a169b18f96
4
- data.tar.gz: 931412d8a6a6fda9f07e3b996414da0670590e1a
3
+ metadata.gz: 13a92807ec823e335d8c008de7b2ee934f2b2a5a
4
+ data.tar.gz: 0914f1345038c081b84dd22ee1b98f009cbd8bb5
5
5
  SHA512:
6
- metadata.gz: e496c29a689f6b651766f219c4e89b42bf7b105c270601f101e3790a53df2eba8e1cfb43df0c4d54f3faffff7c195819307d97bdabe49740e454c6eff1fc7dd4
7
- data.tar.gz: ff5fd16fc53b58e2bb9a9dfd4198a56428e197f7a3b49c463acbc66ef1f6d2ff96cc2f630244165c143e55293f9bf0811c3dda58c55d2c01f89158425ed346a7
6
+ metadata.gz: 917cd00759988d396425711cc5471641edbf8c02a5434e2cea567a6d4bb1aea8fdb06b429950289631b7338432a528a9bd82033a154c6ccdf58a5ca835deed4d
7
+ data.tar.gz: 958687024b4bc80bf5c7364196b0a06c8cfc61e3afce63777c0fa31a5203c6ba892a7089a58e0539d2a6976c53fae2f4557f47a279eea89718d0d9cdc2cb0dc1
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,8 @@
1
+ # 2.1.32
2
+
3
+ * Better naming when using Resque + ActiveJob
4
+ * Better naming when using Sidekiq + DelayedExtension
5
+
1
6
  # 2.1.31
2
7
 
3
8
  * Better detection of Resque queue names
@@ -55,8 +55,6 @@ module ScoutApm
55
55
  # We insert this middleware into the Sidekiq stack, to capture each job,
56
56
  # and time them.
57
57
  class SidekiqMiddleware
58
- ACTIVE_JOB_KLASS = 'ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper'.freeze
59
-
60
58
  def call(_worker, msg, queue)
61
59
  req = ScoutApm::RequestManager.lookup
62
60
  req.job!
@@ -79,12 +77,30 @@ module ScoutApm
79
77
  end
80
78
 
81
79
  UNKNOWN_CLASS_PLACEHOLDER = 'UnknownJob'.freeze
80
+ ACTIVE_JOB_KLASS = 'ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper'.freeze
81
+ DELAYED_WRAPPER_KLASS = 'Sidekiq::Extensions::DelayedClass'.freeze
82
+
82
83
 
83
84
  def job_class(msg)
84
85
  job_class = msg.fetch('class', UNKNOWN_CLASS_PLACEHOLDER)
86
+
85
87
  if job_class == ACTIVE_JOB_KLASS && msg.key?('wrapped')
86
- job_class = msg['wrapped']
88
+ begin
89
+ job_class = msg['wrapped']
90
+ rescue
91
+ ACTIVE_JOB_KLASS
92
+ end
93
+ elsif job_class == DELAYED_WRAPPER_KLASS
94
+ begin
95
+ yml = msg['args'].first
96
+ deserialized_args = YAML.load(yml)
97
+ klass, method, *rest = deserialized_args
98
+ job_class = [klass,method].map(&:to_s).join(".")
99
+ rescue
100
+ DELAYED_WRAPPER_KLASS
101
+ end
87
102
  end
103
+
88
104
  job_class
89
105
  rescue
90
106
  UNKNOWN_CLASS_PLACEHOLDER
@@ -5,6 +5,11 @@ module ScoutApm
5
5
  job_name = self.to_s
6
6
  queue = find_queue
7
7
 
8
+ if job_name == "ActiveJob::QueueAdapters::ResqueAdapter::JobWrapper"
9
+ job_name = args.first["job_class"] rescue job_name
10
+ queue = args.first["queue_name"] rescue queue_name
11
+ end
12
+
8
13
  req = ScoutApm::RequestManager.lookup
9
14
  req.job!
10
15
 
@@ -1,4 +1,4 @@
1
1
  module ScoutApm
2
- VERSION = "2.1.31"
2
+ VERSION = "2.1.32"
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.31
4
+ version: 2.1.32
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-09-05 00:00:00.000000000 Z
12
+ date: 2017-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest