callstacking-rails 0.1.22 → 0.1.23
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14947016af46faef4737e8800c6ea1617d81abf78076e4a072380159251c8348
|
4
|
+
data.tar.gz: 0ff0f0eae09415b28d483ca95cb5f958e106b26472020318c7a8225897203f27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e33a35232719a2e04a38ae4847ac9ad09831ca41ae134568075044b040fed4e458a4de86301a5ba97fc77bea5213f02a97e78a137d33023004dfe06b48cfca5
|
7
|
+
data.tar.gz: 51f3877adb56b49a595c6ee478b89f66048aa4aa2b4e8f10c2920a4e2ead2dc16c29079cf639b62f667f2e774d6f541892cbe88c1c2c581f98262e6d19dd82ed
|
@@ -17,7 +17,7 @@ require "callstacking/rails/time_based_uuid"
|
|
17
17
|
module Callstacking
|
18
18
|
module Rails
|
19
19
|
class Engine < ::Rails::Engine
|
20
|
-
EXCLUDED_TEST_CLASSES = [
|
20
|
+
EXCLUDED_TEST_CLASSES = %w[test/dummy/app/models/salutation.rb test/dummy/app/controllers/application_controller.rb].freeze
|
21
21
|
|
22
22
|
cattr_accessor :spans, :trace, :settings, :instrumenter, :loader
|
23
23
|
|
@@ -5,13 +5,12 @@ module Callstacking
|
|
5
5
|
module Rails
|
6
6
|
class Instrument
|
7
7
|
attr_accessor :spans
|
8
|
-
attr_reader :
|
8
|
+
attr_reader :settings, :span_modules
|
9
9
|
|
10
10
|
def initialize(spans)
|
11
11
|
@spans = spans
|
12
12
|
@span_modules = Set.new
|
13
13
|
@settings = Callstacking::Rails::Settings.new
|
14
|
-
@root = Regexp.new(::Rails.root.to_s) # <-------
|
15
14
|
end
|
16
15
|
|
17
16
|
def instrument_method(klass, method_name, application_level: true)
|
@@ -19,7 +18,7 @@ module Callstacking
|
|
19
18
|
(klass.method(method_name).source_location.first rescue nil)
|
20
19
|
|
21
20
|
# Application level method definitions
|
22
|
-
return if method_path =~ /#{::Rails.root.to_s}/
|
21
|
+
return if application_level && !(method_path =~ /#{::Rails.root.to_s}/)
|
23
22
|
|
24
23
|
return if method_path =~ /initializer/i
|
25
24
|
|
@@ -146,7 +145,6 @@ module Callstacking
|
|
146
145
|
@filtered ||= (Object.instance_methods + Object.private_instance_methods +
|
147
146
|
Object.protected_instance_methods + Object.methods(false)).uniq
|
148
147
|
end
|
149
|
-
|
150
148
|
end
|
151
149
|
end
|
152
150
|
end
|
@@ -3,9 +3,8 @@ require "rails"
|
|
3
3
|
module Callstacking
|
4
4
|
module Rails
|
5
5
|
class Loader
|
6
|
-
attr_accessor :
|
6
|
+
attr_accessor :instrumenter, :klasses, :excluded
|
7
7
|
def initialize(instrumenter, excluded: [])
|
8
|
-
@root = Regexp.new(::Rails.root.to_s)
|
9
8
|
@excluded = excluded
|
10
9
|
@instrumenter = instrumenter
|
11
10
|
@klasses = Set.new
|
@@ -18,7 +17,7 @@ module Callstacking
|
|
18
17
|
|
19
18
|
excluded_klass = excluded.any? { |ex| path =~ /#{ex}/ }
|
20
19
|
|
21
|
-
if path =~ root &&
|
20
|
+
if path =~ /#{::Rails.root.to_s}/ &&
|
22
21
|
!klasses.include?(klass) &&
|
23
22
|
!excluded_klass
|
24
23
|
instrumenter.instrument_klass(klass)
|
@@ -34,7 +34,7 @@ module Callstacking
|
|
34
34
|
|
35
35
|
start_request(trace_id, tuid,
|
36
36
|
payload[:method], payload[:controller],
|
37
|
-
payload[:action], payload[:format], ::Rails.root,
|
37
|
+
payload[:action], payload[:format], ::Rails.root.to_s,
|
38
38
|
payload[:request]&.original_url || payload[:path],
|
39
39
|
payload[:headers], payload[:params])
|
40
40
|
end
|