stackify-ruby-apm 1.14.7 → 1.14.8

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
  SHA256:
3
- metadata.gz: 881446a181c81d422cdd81f2de4b4ccef409989171d96a53833bbe425f8105c0
4
- data.tar.gz: ed31e237779e881ab4a57d7db2c4dcc7936bbe01b6af256ac4f53d9ae4c96054
3
+ metadata.gz: 071d161a1f209e027f271d462fdc8cdf57c8d68197d8ae1ed6190cebe9e2114b
4
+ data.tar.gz: 815f90aaa08dcd15878bc93e7a18d71619a8cd1f55959ef18c0918267754a3df
5
5
  SHA512:
6
- metadata.gz: 293677dce94cf22be5e9a45fb1e7d9b7090fcbbe76a4a1bb679da719896d3ced92c5e34bc6ef0315ef8c05c3ee8621bcd51bac552e6f02bfce635aa13205f23e
7
- data.tar.gz: 581165dd6ee9b10a02d206a7f985b6980ee1ddb46a9a2de05e194a6a9578596114823eff12cd4dab96277e82e533bb9c742c0ee72e109de2a8e819405fb5f4ce
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.to_h
98
+ config = ::ActiveRecord::Base.connection_db_config
98
99
  else
99
- ::ActiveRecord::Base.connection_config.to_h
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(tracked_func, current_class, class_path, current_method: current_method, tracked_function_name: tracked_function_name, is_transaction: transaction)
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
@@ -36,7 +36,7 @@ module StackifyRubyAPM
36
36
  ctx = Span::Context.new(
37
37
  CATEGORY: 'Web External',
38
38
  SUBCATEGORY: 'Execute',
39
- URL: uri,
39
+ URL: uri.to_s,
40
40
  STATUS: '',
41
41
  METHOD: method_upcase
42
42
  )
@@ -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
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Sets the version of the APM
4
4
  module StackifyRubyAPM
5
- VERSION = '1.14.7'.freeze
5
+ VERSION = '1.14.8'.freeze
6
6
  end
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.7
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-02-09 00:00:00.000000000 Z
11
+ date: 2021-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails