aws-xray 0.16.4 → 0.16.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/aws-xray.gemspec +1 -0
- data/lib/aws/xray/configuration.rb +11 -16
- data/lib/aws/xray/segment.rb +2 -2
- data/lib/aws/xray/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7928f5c7fd83ac39e46cbb525539c50e0c448e99
|
4
|
+
data.tar.gz: 1fb21ce7a1aa3b9ed5598eb2ca2664351ea16c78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef131aa7abd38587411272edf8ea1092907f365e391b1582000ec78977c4ab10fd766a239845d4c6e5c71e456660102276aa9e953154f4504f4b7a5d26b0b510
|
7
|
+
data.tar.gz: 2d44467d2051f591d94e70a133b46ab8d377d160880ea28b1e0c9d879870578efd682897bfb5500581f7873c879036b2cfe6bd32c3c28019d224e528dabe7a70
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# aws-xray
|
2
2
|
[](https://travis-ci.org/taiki45/aws-xray)
|
3
3
|
[](https://badge.fury.io/rb/aws-xray)
|
4
|
+
[](https://coveralls.io/github/taiki45/aws-xray)
|
4
5
|
|
5
6
|
The unofficial AWS X-Ray Tracing SDK for Ruby.
|
6
7
|
It enables you to capture in-coming HTTP requests and out-going HTTP requests and send them to xray-agent automatically.
|
data/aws-xray.gemspec
CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_dependency 'faraday'
|
25
25
|
spec.add_dependency 'rack'
|
26
26
|
spec.add_development_dependency 'bundler'
|
27
|
+
spec.add_development_dependency 'coveralls'
|
27
28
|
spec.add_development_dependency 'pry-byebug'
|
28
29
|
spec.add_development_dependency 'rack-test'
|
29
30
|
spec.add_development_dependency 'rake'
|
@@ -6,19 +6,9 @@ module Aws
|
|
6
6
|
module Xray
|
7
7
|
# thread-unsafe, suppose to be used only in initialization phase.
|
8
8
|
class Configuration
|
9
|
-
option = ENV['AWS_XRAY_LOCATION']
|
10
|
-
DEFAULT_HOST = option ? option.split(':').first : nil
|
11
|
-
DEFAULT_PORT = option ? Integer(option.split(':').last) : nil
|
12
|
-
|
13
|
-
name_option = ENV['AWS_XRAY_NAME']
|
14
|
-
DEFAULT_NAME = name_option ? name_option : nil
|
15
|
-
|
16
|
-
path_option = ENV['AWS_XRAY_EXCLUDED_PATHS']
|
17
|
-
DEFAULT_EXCLUDED_PATHS = path_option ? path_option.split(',') : []
|
18
|
-
|
19
9
|
# @return [String] name Logical service name for this application.
|
20
10
|
def name
|
21
|
-
@name ||=
|
11
|
+
@name ||= ENV['AWS_XRAY_NAME']
|
22
12
|
end
|
23
13
|
attr_writer :name
|
24
14
|
|
@@ -27,17 +17,22 @@ module Aws
|
|
27
17
|
# - port: e.g. 2000
|
28
18
|
def client_options
|
29
19
|
@client_options ||=
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
20
|
+
begin
|
21
|
+
option = (ENV['AWS_XRAY_LOCATION'] || '').split(':')
|
22
|
+
host = option[0]
|
23
|
+
port = option[1]
|
24
|
+
if (host && !host.empty?) && (port && !port.empty?)
|
25
|
+
{ host: host, port: Integer(port) }
|
26
|
+
else
|
27
|
+
{ sock: NullSocket.new }
|
28
|
+
end
|
34
29
|
end
|
35
30
|
end
|
36
31
|
attr_writer :client_options
|
37
32
|
|
38
33
|
# @return [Array<String>]
|
39
34
|
def excluded_paths
|
40
|
-
@excluded_paths ||=
|
35
|
+
@excluded_paths ||= (ENV['AWS_XRAY_EXCLUDED_PATHS'] || '').split(',')
|
41
36
|
end
|
42
37
|
attr_writer :excluded_paths
|
43
38
|
|
data/lib/aws/xray/segment.rb
CHANGED
@@ -53,10 +53,10 @@ module Aws
|
|
53
53
|
case status.to_i
|
54
54
|
when 499
|
55
55
|
cause = Cause.new(stack: caller, message: 'Got 499', type: type)
|
56
|
-
set_error(error: true, throttle: true, cause: cause)
|
56
|
+
set_error(error: true, remote: remote, throttle: true, cause: cause)
|
57
57
|
when 400..498
|
58
58
|
cause = Cause.new(stack: caller, message: 'Got 4xx', type: type)
|
59
|
-
set_error(error: true, cause: cause)
|
59
|
+
set_error(error: true, remote: remote, cause: cause)
|
60
60
|
when 500..599
|
61
61
|
cause = Cause.new(stack: caller, message: 'Got 5xx', type: type)
|
62
62
|
set_error(fault: true, remote: remote, cause: cause)
|
data/lib/aws/xray/version.rb
CHANGED
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.16.
|
4
|
+
version: 0.16.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taiki Ono
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: coveralls
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: pry-byebug
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|