stackify-ruby-apm 1.14.7 → 1.14.8
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 +4 -4
- data/lib/stackify_apm/instrumenter_helper.rb +10 -1
- data/lib/stackify_apm/normalizers/active_record.rb +6 -2
- data/lib/stackify_apm/spies/custom_instrumenter.rb +13 -2
- data/lib/stackify_apm/spies/faraday.rb +1 -1
- data/lib/stackify_apm/transport/agent_http_client.rb +1 -1
- data/lib/stackify_apm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 071d161a1f209e027f271d462fdc8cdf57c8d68197d8ae1ed6190cebe9e2114b
|
4
|
+
data.tar.gz: 815f90aaa08dcd15878bc93e7a18d71619a8cd1f55959ef18c0918267754a3df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35d8996e6e1bdc270ba44a231e405275d7b090efd316daa590aeefe2875a0b586f19b8c280fdab16c8a8e5f9b482038c344b40c1893358528a9e4ffa2b5018d0
|
7
|
+
data.tar.gz: 1ce353e5bf442f5ae8c18a5f1c323f0aa177586dc46942f9082baf1fa1acfc1980b04f3b5745a538f5eab7271c7bfdd0a340e2455d97d1695eafac7c9522d17f
|
@@ -35,6 +35,8 @@ module StackifyRubyAPM
|
|
35
35
|
classspyitem = "#{current_class}Spy"
|
36
36
|
module_consget_spy = Module.const_get(current_class)
|
37
37
|
current_method_without = "_without_apm_#{current_method}"
|
38
|
+
is_private_method = options[:is_private_method] || false
|
39
|
+
is_protected_method = options[:is_protected_method] || false
|
38
40
|
|
39
41
|
unless @custom_instrumented[current_class.to_s]
|
40
42
|
@custom_instrumented[current_class.to_s] = {}
|
@@ -63,7 +65,14 @@ module StackifyRubyAPM
|
|
63
65
|
def install
|
64
66
|
#{current_class}.class_eval do
|
65
67
|
alias_method "#{current_method_without}", "#{current_method}"
|
66
|
-
|
68
|
+
|
69
|
+
#{
|
70
|
+
if is_private_method
|
71
|
+
then "private"
|
72
|
+
elsif is_protected_method
|
73
|
+
then "protected"
|
74
|
+
end
|
75
|
+
}
|
67
76
|
def #{current_method}(*args, &block)
|
68
77
|
if StackifyRubyAPM.current_transaction.nil? && #{!transaction.nil?}
|
69
78
|
t = StackifyRubyAPM.transaction("custom.#{current_class}.#{current_method}", TRACETYPE)
|
@@ -93,10 +93,14 @@ module StackifyRubyAPM
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def lookup_adapter_config
|
96
|
+
config = nil
|
96
97
|
if Gem::Version.new(Rails::VERSION::STRING) >= Gem::Version.new('6.1')
|
97
|
-
::ActiveRecord::Base.connection_db_config
|
98
|
+
config = ::ActiveRecord::Base.connection_db_config
|
98
99
|
else
|
99
|
-
::ActiveRecord::Base.connection_config
|
100
|
+
config = ::ActiveRecord::Base.connection_config
|
101
|
+
end
|
102
|
+
if (config != nil && config.respond_to(:to_h))
|
103
|
+
config.to_h
|
100
104
|
end
|
101
105
|
rescue StandardError => error
|
102
106
|
debug '[SqlNormalizer] lookup_adapter_config err: ' + error.inspect.to_s
|
@@ -70,6 +70,8 @@ module StackifyRubyAPM
|
|
70
70
|
mod_constant = Module.const_get(current_class.to_s)
|
71
71
|
klass_method_flag = mod_constant.method_defined?(current_method.to_s)
|
72
72
|
singleton_method_flag = mod_constant.respond_to?(current_method.to_s)
|
73
|
+
klass_private_method_flag = mod_constant.private_method_defined?(current_method.to_s)
|
74
|
+
klass_protected_method_flag = mod_constant.protected_method_defined?(current_method.to_s)
|
73
75
|
|
74
76
|
class_location = mod_constant.instance_methods(false).map do |m|
|
75
77
|
mod_constant.instance_method(m).source_location.first
|
@@ -77,8 +79,17 @@ module StackifyRubyAPM
|
|
77
79
|
|
78
80
|
class_path = class_location.last
|
79
81
|
|
80
|
-
if klass_method_flag
|
81
|
-
StackifyRubyAPM::InstrumenterHelper.m_class(
|
82
|
+
if klass_method_flag || klass_private_method_flag
|
83
|
+
StackifyRubyAPM::InstrumenterHelper.m_class(
|
84
|
+
tracked_func,
|
85
|
+
current_class,
|
86
|
+
class_path,
|
87
|
+
current_method: current_method,
|
88
|
+
tracked_function_name: tracked_function_name,
|
89
|
+
is_transaction: transaction,
|
90
|
+
is_private_method: klass_private_method_flag,
|
91
|
+
is_protected_method: klass_protected_method_flag
|
92
|
+
)
|
82
93
|
elsif singleton_method_flag
|
83
94
|
StackifyRubyAPM::InstrumenterHelper.m_singleton(tracked_func, current_class, class_path, current_method: current_method, tracked_function_name: tracked_function_name, is_transaction: transaction)
|
84
95
|
end
|
@@ -42,7 +42,7 @@ module StackifyRubyAPM
|
|
42
42
|
message = get_json_message(transactions)
|
43
43
|
conn = Faraday.new(ssl: { verify: false })
|
44
44
|
response = conn.post do |req|
|
45
|
-
req.url URI(@config.transport_http_endpoint + @config.agent_traces_url)
|
45
|
+
req.url URI(@config.transport_http_endpoint + @config.agent_traces_url).to_s
|
46
46
|
req.headers = get_json_headers
|
47
47
|
req.body = message
|
48
48
|
end
|
data/lib/stackify_apm/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stackify-ruby-apm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.14.
|
4
|
+
version: 1.14.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stackify
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|