stackify-ruby-apm 1.7.1 → 1.7.4

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: ca22a5a75e1ae02e39bea7fa1330da6530c522cf33f3e82f4aec4aec2515ef79
4
- data.tar.gz: 3ce816108dfed9e9abdd268b127b5795a41be911da28d16afcc0262e369847f7
3
+ metadata.gz: 701a5bf72b0d237602bbb07c71923d404565da0161c71a36fd1886bfac0fddc9
4
+ data.tar.gz: c91c611b46c3747bdf5f2e840a3c88cdd1562beb1a364cb1a80ba06c6d18ffc4
5
5
  SHA512:
6
- metadata.gz: e9a115fe042f1f9b3021af173ba229ba2bfab15c5685bf57cf851e6292089252f321966c7cf85622942ef853750961641980a38db8452b07e79a17c17a5bc79d
7
- data.tar.gz: 2ce4459279a1661b6ef016ccc33ddf5d9b01d9e2a1eea94e732be98101699920e5ba068d226d2711ac0c754014b6c0607c4b5c441ac476aa72edf8ff39c67ea0
6
+ metadata.gz: 778c0414e397291ee79cfa4a570fa4a85db6f84db87f070591e53102d1b8be76ee46c871518c19fea615d21f9227c3e67b29dd2923468175d5b4a38579fea1e6
7
+ data.tar.gz: 5576bd8a1932c69c0ee70e157d60ba59f4024ebc7230a941f31051c370d31b43203693171ef8f8bc0555cd0ba5d4ccb0161a55210c5ecd8004a7cb3a11e232f8
@@ -20,7 +20,6 @@ module StackifyRubyAPM
20
20
  already_instrumented_flag: false,
21
21
  rum_auto_injection: false,
22
22
  rum_enabled: false,
23
- rum_cookie_max_age: 0,
24
23
  rum_cookie_path: '/',
25
24
  rum_cookie_name: '.Stackify.Rum',
26
25
  instrument: true,
@@ -85,10 +84,10 @@ module StackifyRubyAPM
85
84
  set_from_args(options)
86
85
  set_from_config_file
87
86
  set_from_env
88
-
89
87
  yield self if block_given?
90
88
  debug_logger
91
89
  StackifyRubyAPM::Util.host_os == 'WINDOWS' ? load_stackify_props_windows : load_stackify_props
90
+ validate_apm_yml
92
91
  end
93
92
 
94
93
  attr_accessor :config_file
@@ -97,7 +96,6 @@ module StackifyRubyAPM
97
96
  attr_accessor :rum_script_src
98
97
  attr_accessor :rum_auto_injection
99
98
  attr_accessor :rum_enabled
100
- attr_accessor :rum_cookie_max_age
101
99
  attr_accessor :rum_cookie_path
102
100
  attr_accessor :rum_cookie_name
103
101
  attr_accessor :already_instrumented_flag
@@ -159,10 +157,6 @@ module StackifyRubyAPM
159
157
  end
160
158
 
161
159
  def app_type?(app)
162
- # if defined?(::Rails) && app.is_a?(Rails::Application)
163
- # return :rails
164
- # end
165
-
166
160
  return :rails if defined?(::Rails) && app.is_a?(Rails::Application)
167
161
 
168
162
  nil
@@ -339,5 +333,16 @@ module StackifyRubyAPM
339
333
  end
340
334
  # rubocop:enable Metrics/CyclomaticComplexity
341
335
  # rubocop:enable Metrics/PerceivedComplexity
336
+
337
+ # rubocop:disable Metrics/CyclomaticComplexity
338
+ # rubocop:disable Metrics/PerceivedComplexity
339
+ def validate_apm_yml
340
+ info '[Config] rum_enabled must be Boolean type: true/false.' unless [TrueClass, FalseClass].include?(@rum_enabled.class) && defined?(@rum_enabled)
341
+ info '[Config] rum_auto_injection must be Boolean type: true/false.' unless [TrueClass, FalseClass].include?(@rum_auto_injection.class) && defined?(@rum_auto_injection)
342
+ info '[Config] application_name must be String type.' unless @application_name.is_a?(String) && defined?(@application_name)
343
+ info '[Config] environment_name must be String type.' unless @environment_name.is_a?(String) && defined?(@environment_name)
344
+ end
345
+ # rubocop:enable Metrics/CyclomaticComplexity
346
+ # rubocop:enable Metrics/PerceivedComplexity
342
347
  end
343
348
  end
@@ -50,16 +50,16 @@ module StackifyRubyAPM
50
50
 
51
51
  if okay_to_modify?
52
52
  @configuration.already_instrumented_flag = true
53
- if @configuration.rum_auto_injection
53
+ if @configuration.rum_auto_injection.is_a?(TrueClass)
54
54
  response_string = response_manupulate.adjust_pagehtml_response
55
55
  end
56
56
  if response_string
57
57
  response = Rack::Response.new(response_string, @rack_status, @rack_headers)
58
- response.set_cookie(@configuration.rum_cookie_name, value: transaction.id, path: @configuration.rum_cookie_path, max_age: @configuration.rum_cookie_max_age) if @configuration.rum_enabled
58
+ response.set_cookie(@configuration.rum_cookie_name, value: transaction.id, path: @configuration.rum_cookie_path) if @configuration.rum_enabled.is_a?(TrueClass)
59
59
  resp = response.finish
60
- elsif @configuration.rum_enabled
60
+ elsif @configuration.rum_enabled.is_a?(TrueClass)
61
61
  response = Rack::Response.new @rack_body, @rack_status, @rack_headers
62
- response.set_cookie(@configuration.rum_cookie_name, value: transaction.id, path: @configuration.rum_cookie_path, max_age: @configuration.rum_cookie_max_age)
62
+ response.set_cookie(@configuration.rum_cookie_name, value: transaction.id, path: @configuration.rum_cookie_path)
63
63
  resp = response.finish
64
64
  else
65
65
  resp
@@ -35,6 +35,7 @@ module StackifyRubyAPM
35
35
  hash[:METHOD] = @transaction.context.request.method if @transaction.context && @transaction.context.request && @transaction.context.request.method
36
36
  hash[:STATUS] = @transaction.context.response.status_code if @transaction.context && @transaction.context.response && @transaction.context.response.status_code
37
37
  hash[:URL] = @transaction.context.request.url[:full] if @transaction.context && @transaction.context.request && @transaction.context.request.url[:full]
38
+ hash[:RUM] = true if @config.rum_enabled.is_a?(TrueClass)
38
39
  hash
39
40
  end
40
41
  # rubocop:enable Metrics/CyclomaticComplexity
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Sets the version of the APM
4
4
  module StackifyRubyAPM
5
- VERSION = '1.7.1'.freeze
5
+ VERSION = '1.7.4'.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.7.1
4
+ version: 1.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stackify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-22 00:00:00.000000000 Z
11
+ date: 2019-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler