aws-xray 0.16.4 → 0.16.5

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: c18e62bee058b20f2bbfc0a46732b491974cfd1b
4
- data.tar.gz: 245d0a54a8eda2e84fb317eaed923f7aa340a042
3
+ metadata.gz: 7928f5c7fd83ac39e46cbb525539c50e0c448e99
4
+ data.tar.gz: 1fb21ce7a1aa3b9ed5598eb2ca2664351ea16c78
5
5
  SHA512:
6
- metadata.gz: c25b50647422653efcaecaae9fef3d22be3aa70dd90ee24839531f0a64e39905d34bd43c529793cda76a90865ba43e6674245640127a804479b480978f662952
7
- data.tar.gz: 4e7ef29b919b9ae8d97d9027c7c99397611df28216196d6782bdee3476269aff99aaed83cc5034979e112b13c5c8d7bdd71b233b3c6521bea657bc70b371203d
6
+ metadata.gz: ef131aa7abd38587411272edf8ea1092907f365e391b1582000ec78977c4ab10fd766a239845d4c6e5c71e456660102276aa9e953154f4504f4b7a5d26b0b510
7
+ data.tar.gz: 2d44467d2051f591d94e70a133b46ab8d377d160880ea28b1e0c9d879870578efd682897bfb5500581f7873c879036b2cfe6bd32c3c28019d224e528dabe7a70
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # aws-xray
2
2
  [![Build Status](https://travis-ci.org/taiki45/aws-xray.svg?branch=master)](https://travis-ci.org/taiki45/aws-xray)
3
3
  [![Gem Version](https://badge.fury.io/rb/aws-xray.svg)](https://badge.fury.io/rb/aws-xray)
4
+ [![Coverage Status](https://coveralls.io/repos/github/taiki45/aws-xray/badge.svg)](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.
@@ -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 ||= DEFAULT_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
- if DEFAULT_HOST && DEFAULT_PORT
31
- { host: DEFAULT_HOST, port: DEFAULT_PORT }
32
- else
33
- { sock: NullSocket.new }
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 ||= DEFAULT_EXCLUDED_PATHS
35
+ @excluded_paths ||= (ENV['AWS_XRAY_EXCLUDED_PATHS'] || '').split(',')
41
36
  end
42
37
  attr_writer :excluded_paths
43
38
 
@@ -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)
@@ -1,5 +1,5 @@
1
1
  module Aws
2
2
  module Xray
3
- VERSION = '0.16.4'
3
+ VERSION = '0.16.5'
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.16.4
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