aws-xray 0.20.2 → 0.20.3

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
  SHA1:
3
- metadata.gz: 231791ce8d888fca58f8fe0e3585d0274d04264b
4
- data.tar.gz: 6d0ee6a959f020d778434e12208b56ce210a1215
3
+ metadata.gz: 9dfe984713294a18508d8dd9a9b74573c3ed71b2
4
+ data.tar.gz: cb82d27ce6d019ccc30fd24b9c80cb76d733b28b
5
5
  SHA512:
6
- metadata.gz: d103436545a4a1e2f9dba0064397502302592c61573070f9bb219dfffa358d4234bea88d47b1cddeb9de0fc6b4c11eda9f163bea073b8a59525d639a16c0936a
7
- data.tar.gz: c3c6e440be855d2161e70898261559e1ce7464d286f288026b63c68130bc4e4b0e91ec732b55777cb54e8c83858780e6c97fba7e5ec07bd274d20565990de997
6
+ metadata.gz: 4d888a9adb83016a41983c6304c09c202549a84e2c20e9c39319f3c914031796598a7aa9dc17ec9ace5b456e9068f5cda9007c0813aeae7898ee38941d979475
7
+ data.tar.gz: a132d3e8c255d6ac72665f5a3461508c0b2c3c5138fb29967c1a75690243a3942fdb56ba527bb5ae8250c2953fdc2f1e757d194e9a2afbc5aa5db72fe2698db6
data/README.md CHANGED
@@ -115,7 +115,7 @@ If you can't access headers, e.g. external client library like aws-sdk or dogapi
115
115
 
116
116
  ```ruby
117
117
  client = Aws::Sns::Client.new
118
- response = Aws::Xray::Context.current.overwrite(name: 'sns') do
118
+ response = Aws::Xray.overwrite(name: 'sns') do
119
119
  client.create_topic(...)
120
120
  end
121
121
  ```
@@ -32,5 +32,16 @@ module Aws
32
32
  end
33
33
  end
34
34
  end
35
+
36
+ # Overwrite under lying tracing name at once. If current context does not
37
+ # set to current thread, do nothing.
38
+ # @param [String] name
39
+ def self.overwrite(name:, &block)
40
+ if Context.started?
41
+ Context.current.overwrite(name: name, &block)
42
+ else
43
+ block.call
44
+ end
45
+ end
35
46
  end
36
47
  end
@@ -126,12 +126,15 @@ module Aws
126
126
  @disabled_ids.include?(id)
127
127
  end
128
128
 
129
- # Temporary overwrite sub segment with given data in given block.
130
- # The overwriting will be occured only one time.
131
129
  # CAUTION: the injection will NOT be propagated between threads!!
132
130
  #
131
+ # Temporary overwrite subsegment with the name in the block. The
132
+ # overwriting will be occured only one time.
133
+ #
133
134
  # @param [String] name
134
135
  def overwrite(name:)
136
+ return yield if @subsegment_name
137
+
135
138
  @subsegment_name = name.to_s
136
139
 
137
140
  begin
@@ -1,5 +1,5 @@
1
1
  module Aws
2
2
  module Xray
3
- VERSION = '0.20.2'
3
+ VERSION = '0.20.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-xray
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.2
4
+ version: 0.20.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taiki Ono