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 +4 -4
- data/README.md +1 -1
- data/lib/aws/xray.rb +11 -0
- data/lib/aws/xray/context.rb +5 -2
- data/lib/aws/xray/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dfe984713294a18508d8dd9a9b74573c3ed71b2
|
4
|
+
data.tar.gz: cb82d27ce6d019ccc30fd24b9c80cb76d733b28b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
118
|
+
response = Aws::Xray.overwrite(name: 'sns') do
|
119
119
|
client.create_topic(...)
|
120
120
|
end
|
121
121
|
```
|
data/lib/aws/xray.rb
CHANGED
@@ -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
|
data/lib/aws/xray/context.rb
CHANGED
@@ -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
|
data/lib/aws/xray/version.rb
CHANGED