aws-xray-sdk 0.11.0 → 0.11.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: 91c311c0f94185bc3f4a17afbfde8f7a4f881503feeb7eb116a43631c6649efc
4
- data.tar.gz: 4a2791948dc071dfa2e57f410eb60311ff812aa276f0968dfc85db28632a2565
3
+ metadata.gz: 3ef8621b715e92340eb2dfe27f470fd8e4c92d45d0b21f20d814d3a0b298d323
4
+ data.tar.gz: dc4471eebd695a0e4c7fd31cd7b84709ba166a395f6c31785a482272c0a162b6
5
5
  SHA512:
6
- metadata.gz: 7c9caa633a61621f6c17a281c416855aef63033f8c8119589c0c1bff70218c80f7b84234251f97be5a7cf5b3d39a1d0dc8c54fb8c619ec46c9ab37aabb323bf8
7
- data.tar.gz: 42cce4783e4dfa257317a1c3b6bca7fd52e2b4b1521b313048b1c8e1037a9bb85596e2b70a15fca54b15777fc941b380114bf5deec452062a1ea5bc73ac4b4ef
6
+ metadata.gz: 656c7425f811713ea11d7e4fb8515d597513c8412f1f77b6a2445c0695b7ff91772815efc349695c49688cb3a1ee07408c4e863811ad40dcde58e8585942dff5
7
+ data.tar.gz: fbab0222d5abc0048c0fd32a443b1974ad72072386779e858ef88aa541b2bc2797f44ac9ae3a1ae21c066e44973fa30f0c5d78c7e2523a1d32f26d8b1c417f6f
@@ -9,7 +9,6 @@ module XRay
9
9
  class ServiceConnector
10
10
  include Logging
11
11
  attr_accessor :xray_client
12
- @@client_id = SecureRandom.hex(12)
13
12
 
14
13
  def initialize
15
14
  update_xray_client
@@ -46,6 +45,12 @@ module XRay
46
45
  update_xray_client ip: v.tcp_ip, port: v.tcp_port
47
46
  end
48
47
 
48
+ def client_id
49
+ @client_id ||= begin
50
+ SecureRandom.hex(12)
51
+ end
52
+ end
53
+
49
54
  private
50
55
 
51
56
  def generate_reports(rules, now)
@@ -54,7 +59,7 @@ module XRay
54
59
  report = rule.snapshot_statistics
55
60
  report[:rule_name] = rule.name
56
61
  report[:timestamp] = now
57
- report[:client_id] = @@client_id
62
+ report[:client_id] = client_id
58
63
  reports << report
59
64
  end
60
65
  reports
@@ -9,10 +9,12 @@ module XRay
9
9
  def initialize(cache:, connector:)
10
10
  @cache = cache
11
11
  @connector = connector
12
- @worker = Thread.new { poll }
13
12
  end
14
13
 
15
14
  def run
15
+ @worker ||= begin
16
+ Thread.new { poll }
17
+ end
16
18
  @worker.run
17
19
  end
18
20
 
@@ -20,8 +22,8 @@ module XRay
20
22
 
21
23
  def poll
22
24
  loop do
23
- Thread.stop
24
25
  refresh_cache
26
+ Thread.stop
25
27
  end
26
28
  end
27
29
 
@@ -33,7 +35,7 @@ module XRay
33
35
  @cache.last_updated = now
34
36
  end
35
37
  rescue StandardError => e
36
- logger.warn %(failed to fetch X-Ray sampling rules due to #{e.backtrace})
38
+ logger.warn %(failed to fetch X-Ray sampling rules due to #{e.message})
37
39
  end
38
40
  end
39
41
  end
@@ -1,3 +1,3 @@
1
1
  module XRay
2
- VERSION = '0.11.0'
2
+ VERSION = '0.11.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-xray-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-25 00:00:00.000000000 Z
11
+ date: 2018-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-xray