alacrity-rails 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/alacrity-rails.rb +12 -0
- data/lib/alacrity-rails/probe/active_job.rb +18 -0
- data/lib/alacrity-rails/probe/sidekiq.rb +4 -0
- data/lib/alacrity-rails/railtie.rb +1 -11
- data/lib/alacrity-rails/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: 7666d6b3cb82b1026dc43efb158d4033bb84475e
|
4
|
+
data.tar.gz: ee882991c3880d6b931ebca2960d27d228582d12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3518a958c64a7529d4c208a842827282caf65d8fcd1ce27274184f36b20235ee5e1601b5dd42a2da1ef7eb336ced76f82975ebc05d3dffa2c243842083d92642
|
7
|
+
data.tar.gz: 8da3cf36ce329bcab43f9b6194e75065e6a1a317adfc87f1cfa53bb077a88d0f55325dc65fb16ccba09e40a474aa05ecb4a5971b5f431919ff0167f441bee2f6
|
data/lib/alacrity-rails.rb
CHANGED
@@ -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
|
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.
|
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-
|
11
|
+
date: 2018-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|