stackify-ruby-apm 1.2.4 → 1.3.1

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: c797df00561661da936aeef53e4064ac64a7742156b7c83c6ba770880202f53f
4
- data.tar.gz: 32f9a06b9f3b0ab131c552d7cbfa3e22dd074b5689e67ed5d42cb3edd99c43a0
3
+ metadata.gz: e69ba17aa5e795974868a28d69a053d1e40a1991a9894d7b76e38fc147cdbc15
4
+ data.tar.gz: d556ea3ecff8621cb3024f33a82d396fa74a5582a5d86f34077cda9cf79ca60b
5
5
  SHA512:
6
- metadata.gz: 8ca79814064746539fb96db7d3e5ff5241c8213973a9fba444fc69507756e60d138e4335202bc73d0ca5a6e2df1984afeeb6836b98681f64bf06f7337523b28f
7
- data.tar.gz: 824820eb08bd65189a0292d3c0f6d8138923aff31552828bc788a072ad781d7bb660c51fe7439eb00891a8a9597713ed92178f7133fe9a13fb7d86a0becf6952
6
+ metadata.gz: ab0cc4910e4b1004e7d78074df65000a6d3c23d47f4b1cab36a5613418e9a4752c216bd0c1cfd2b476be6716eb877a36a1e3dc0e66b85d480f0f10f27994ab35
7
+ data.tar.gz: 199c9b05f7d9abbbddf4dce9aefd25b58edb61ee4aee28cd43ad88b225b5edc6b4e129f97dff2c7bfb3300b0bdb8330b1e3dd2202c611d49ef6d405f2693d7b7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stackify-ruby-apm (1.1.1)
4
+ stackify-ruby-apm (1.3.0)
5
5
  concurrent-ruby (~> 1.0)
6
6
  delegate_matcher (~> 0.4)
7
7
  rufus-scheduler (~> 3.5)
@@ -60,7 +60,7 @@ GEM
60
60
  domain_name (0.5.20180417)
61
61
  unf (>= 0.0.5, < 1.0.0)
62
62
  erubis (2.7.0)
63
- et-orbi (1.1.7)
63
+ et-orbi (1.2.1)
64
64
  tzinfo
65
65
  fakeredis (0.7.0)
66
66
  redis (>= 3.2, < 5.0)
@@ -68,8 +68,8 @@ GEM
68
68
  multipart-post (>= 1.2, < 3)
69
69
  file-tail (1.2.0)
70
70
  tins (~> 1.0)
71
- fugit (1.1.8)
72
- et-orbi (~> 1.1, >= 1.1.7)
71
+ fugit (1.2.1)
72
+ et-orbi (~> 1.1, >= 1.1.8)
73
73
  raabro (~> 1.1)
74
74
  globalid (0.4.2)
75
75
  activesupport (>= 4.2.0)
@@ -163,16 +163,16 @@ GEM
163
163
  ruby-progressbar (~> 1.7)
164
164
  unicode-display_width (~> 1.0, >= 1.0.1)
165
165
  ruby-progressbar (1.10.0)
166
- ruby2ruby (2.4.1)
166
+ ruby2ruby (2.4.2)
167
167
  ruby_parser (~> 3.1)
168
168
  sexp_processor (~> 4.6)
169
- ruby_parser (3.12.0)
169
+ ruby_parser (3.13.1)
170
170
  sexp_processor (~> 4.9)
171
- rufus-scheduler (3.5.2)
172
- fugit (~> 1.1, >= 1.1.5)
171
+ rufus-scheduler (3.6.0)
172
+ fugit (~> 1.1, >= 1.1.6)
173
173
  safe_yaml (1.0.5)
174
174
  sequel (5.18.0)
175
- sexp_processor (4.11.0)
175
+ sexp_processor (4.12.0)
176
176
  sinatra (1.4.8)
177
177
  rack (~> 1.5)
178
178
  rack-protection (~> 1.4)
@@ -285,13 +285,14 @@ module StackifyRubyAPM
285
285
  @client_run_domain = line.split('=')[1].strip
286
286
  end
287
287
  end
288
- info "stackify.properties: clientId=#{@client_id}, deviceId=#{@device_id}"
288
+ info "stackify.properties: clientId=#{@client_id}, deviceId=#{@device_id}, client_rum_domain=#{@client_run_domain}"
289
289
  rescue StandardError => e
290
290
  info 'Error occured while reading the stackify.properties file.'
291
291
  info e.inspect
292
292
  end
293
293
  info 'No clientId found from stackify.properties file.' if @client_id.nil?
294
294
  info 'No deviceId found from stackify.properties file.' if @device_id.nil?
295
+ info 'No client RUM domain found from stackify.properties file.' if @client_run_domain.nil?
295
296
  end
296
297
  # rubocop:enable Metrics/CyclomaticComplexity
297
298
  end
@@ -65,21 +65,16 @@ module StackifyRubyAPM
65
65
  client_id = @config.client_id
66
66
  device_id = @config.device_id
67
67
  client_rundomain = @config.client_run_domain
68
- transaction_id = defined?(StackifyRubyAPM.current_transaction.id) ? StackifyRubyAPM.current_transaction.id : nil
69
- data_request_id = 'V2|' + transaction_id + '|C' + client_id + '|' + device_id
70
68
  inject_flag = false
71
69
 
72
- if client_rundomain != '' && StackifyRubyAPM.check_isdomain(client_rundomain)
70
+ if client_rundomain != '' && StackifyRubyAPM.check_isdomain(client_rundomain) && client_id && device_id
73
71
  inject_flag = true
74
72
  else
75
73
  warn 'ClientRumDomain might be empty or Invalid URL stackify.properties.'
76
74
  end
77
75
 
78
- jsfile_to_inject = '<script src="' + @config.rum_script_src + '" data-host="' + client_rundomain + '"
79
- data-requestId="' + data_request_id + '"
80
- data-a="' + @config.application_name + '"
81
- data-e="' + @config.environment_name + '"
82
- data-enableInternalLogging="' + @config.debug_logging.to_s + '" type="text/javascript" async></script>'
76
+ return unless inject_flag
77
+ jsfile_to_inject = StackifyRubyAPM.inject_rum_script
83
78
 
84
79
  # Only scan the first 50k (roughly) then give up.
85
80
  beginning_of_source = source[0..SCAN_LIMIT]
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Sets the version of the APM
4
4
  module StackifyRubyAPM
5
- VERSION = '1.2.4'.freeze
5
+ VERSION = '1.3.1'.freeze
6
6
  end
@@ -40,22 +40,25 @@ module StackifyRubyAPM
40
40
  Agent.start config
41
41
  end
42
42
 
43
+ # rubocop:disable Metrics/CyclomaticComplexity
44
+ # rubocop:disable Metrics/PerceivedComplexity
43
45
  def self.inject_rum_script
44
46
  config = StackifyRubyAPM::Config.new
45
47
  client_id = config.client_id
46
48
  device_id = config.device_id
47
49
  client_rundomain = config.client_run_domain
48
50
  transaction_id = defined?(StackifyRubyAPM.current_transaction.id) ? StackifyRubyAPM.current_transaction.id : nil
49
- data_request_id = 'V2|' + transaction_id + '|C' + client_id + '|' + device_id
51
+
50
52
  inject_flag = false
51
53
 
52
- if client_rundomain != '' && check_isdomain(client_rundomain)
54
+ if client_rundomain != '' && check_isdomain(client_rundomain) && client_id && device_id
53
55
  inject_flag = true
54
56
  else
55
57
  warn 'ClientRumDomain might be empty or Invalid URL stackify.properties.'
56
58
  end
57
59
 
58
60
  return unless inject_flag
61
+ data_request_id = 'V2|' + transaction_id + '|C' + client_id + '|CD' + device_id
59
62
  @rum_script_injected = true
60
63
  "<script src=\"#{config.rum_script_src}\" data-host=\"#{client_rundomain}\" data-requestId=\"#{data_request_id}\"
61
64
  data-a=\"#{config.application_name}\" data-e=\"#{config.environment_name}\" data-enableInternalLogging=\"#{config.debug_logging}\" type=\"text/javascript\" async></script>"
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.2.4
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stackify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-21 00:00:00.000000000 Z
11
+ date: 2019-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler