alacrity-rails 0.12.0 → 0.13.0

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: 4e71baac37d033be722f516ca9e2517f37acb4a1
4
- data.tar.gz: f56b3bc0f27d22f9790d6fd2effd77bb4ef8174d
3
+ metadata.gz: 7666d6b3cb82b1026dc43efb158d4033bb84475e
4
+ data.tar.gz: ee882991c3880d6b931ebca2960d27d228582d12
5
5
  SHA512:
6
- metadata.gz: a94cc4f73f7f24f4a148aedff5494fa993cf30c14e012a0b516b53a5fdad4f7cdfcbe54c502b9b68a5337caf2ddd083c23d3ab01470a02b9f213ebe82c9112f7
7
- data.tar.gz: 86f3312d6b307c6b7f30262ee32836d3c3026a0cb8145c9af848de9eaa7057a7cd3d383a66cd64d5dd58657f683e6e11667299890be437cd11e476e7d0e37b05
6
+ metadata.gz: 3518a958c64a7529d4c208a842827282caf65d8fcd1ce27274184f36b20235ee5e1601b5dd42a2da1ef7eb336ced76f82975ebc05d3dffa2c243842083d92642
7
+ data.tar.gz: 8da3cf36ce329bcab43f9b6194e75065e6a1a317adfc87f1cfa53bb077a88d0f55325dc65fb16ccba09e40a474aa05ecb4a5971b5f431919ff0167f441bee2f6
@@ -23,6 +23,18 @@ module AlacrityRails
23
23
  autoload :MongoDriver, 'alacrity-rails/probe/mongo_driver'
24
24
  autoload :Sidekiq, 'alacrity-rails/probe/sidekiq'
25
25
  autoload :SidekiqServerMiddleware, 'alacrity-rails/probe/sidekiq'
26
+
27
+ LIST = [
28
+ Probe::ActionController,
29
+ Probe::ActionMailer,
30
+ Probe::ActionView,
31
+ Probe::ActiveJob,
32
+ Probe::ActiveModelSerializers,
33
+ Probe::ActiveRecord,
34
+ Probe::MongoDriver,
35
+ Probe::Excon,
36
+ Probe::Sidekiq
37
+ ].freeze
26
38
  end
27
39
 
28
40
  module Transaction
@@ -16,3 +16,21 @@ module AlacrityRails
16
16
  end
17
17
  end
18
18
  end
19
+
20
+ class ::ActiveJob::Base
21
+ around_perform :alacrity_instrumentor
22
+
23
+ private
24
+
25
+ def alacrity_instrumentor
26
+ AlacrityRails::Instrumentor.instrument(
27
+ type: AlacrityRails::Transaction::Job,
28
+ data: {
29
+ worker_class: self.class.to_s,
30
+ args: @arguments
31
+ }
32
+ ) do
33
+ yield
34
+ end
35
+ end
36
+ end
@@ -1,7 +1,11 @@
1
1
  module AlacrityRails
2
2
  module Probe
3
3
  class SidekiqServerMiddleware
4
+ ACTIVE_JOB_WRAPPER = /^ActiveJob::QueueAdapters::.+$/
5
+
4
6
  def call(worker_instance, msg, queue)
7
+ return if ACTIVE_JOB_WRAPPER.match(msg['class'])
8
+
5
9
  AlacrityRails::Instrumentor.instrument(
6
10
  type: AlacrityRails::Transaction::Job,
7
11
  data: {
@@ -6,17 +6,7 @@ module AlacrityRails
6
6
 
7
7
  config.middleware.insert_before 0, AlacrityRails::Middleware
8
8
 
9
- [
10
- Probe::ActionController,
11
- Probe::ActionMailer,
12
- Probe::ActionView,
13
- Probe::ActiveJob,
14
- Probe::ActiveModelSerializers,
15
- Probe::ActiveRecord,
16
- Probe::MongoDriver,
17
- Probe::Excon,
18
- Probe::Sidekiq
19
- ].each(&:activate)
9
+ Probe::LIST.each(&:activate)
20
10
  end
21
11
  end
22
12
  end
@@ -1,3 +1,3 @@
1
1
  module AlacrityRails
2
- VERSION = '0.12.0'
2
+ VERSION = '0.13.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alacrity-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alacrity, LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-24 00:00:00.000000000 Z
11
+ date: 2018-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails