aws-xray 0.9.3 → 0.9.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b3ff7a0a063b0f2d11f2764e6350e4679e69bbd
4
- data.tar.gz: 731f70968ec41d406703f3194c89fba607a793ab
3
+ metadata.gz: e1f4338978e5b5f21c1c98380b076d3e4a22e7d6
4
+ data.tar.gz: 510b3414f6eca43c15be7c8d4f606251afb8e950
5
5
  SHA512:
6
- metadata.gz: 9e753bb18782981bd36f04e6ea531306cb65a5f79c4d9c094dec85f9e7bcf41470dc9e27886185c014065ad79753bab755367c69ffd789eb139ed09f0a1394b0
7
- data.tar.gz: 6a96d9460974106dbbc9a5b05240ddb0030f98c714f16a1e57dfb0fea2fc500a52fe731401af1918ef0183fef554f396bd12c06a30b754f80b424ebde30aa031
6
+ metadata.gz: f2c7f88c0eed8afbea49ff32739b3e58720c297c929635f3bc517792a3283146b13f94f4dcbd8b046057bcc6b7318b1c5c8be9d4b5d95a3a7ec91ba27c2285b3
7
+ data.tar.gz: dc3ab34565c1eb7847357c428b0f9e56ac7ed8d44a2895e86d395a51244082fe8c050fdc5d5aa56c073cbef53585060ab12ed6797acf27e453de303f80e2afc9
data/README.md CHANGED
@@ -29,15 +29,7 @@ And then execute:
29
29
 
30
30
  ## Usage
31
31
  ### Rails app
32
- Insert Rack middleware by yourself:
33
-
34
- ```
35
- # config/initializers/aws_xray.rb
36
- Aws::Xray.config.name = 'my-app'
37
- Rails.application.config.middleware.use Aws::Xray::Rack
38
- ```
39
-
40
- Or just require `aws/xray/rails`. It uses your application name by default.
32
+ Just require `aws/xray/rails`. It uses your application name by default.
41
33
  e.g. `Legacy::MyBlog` -> `legacy-my-blog`.
42
34
 
43
35
  ```ruby
@@ -90,7 +82,7 @@ end
90
82
  Aws::Xray.trace(name: 'my-app-batch') do |seg|
91
83
  client.get('/foo')
92
84
 
93
- Aws::Xray::Context.current.child_trace do |sub|
85
+ Aws::Xray::Context.current.child_trace(name: 'fetch-user', remote: true) do |sub|
94
86
  # DB access or something to trace.
95
87
  end
96
88
  end
@@ -98,13 +90,13 @@ end
98
90
 
99
91
  ## Configurations
100
92
  ### X-Ray agent location
101
- aws-xray does not send any trace data default. Set `AWS_XRAY_LOCATION` environment variable like `AWS_XRAY_LOCATION=localhost:2000`
93
+ aws-xray does not send any trace data dby efault. Set `AWS_XRAY_LOCATION` environment variable like `AWS_XRAY_LOCATION=localhost:2000`
102
94
  or set proper aws-agent location with configuration interface like `Aws::Xray.config.client_options = { host: "localhost", port: 2000 }`.
103
95
 
104
96
  In container environments, we often run xray agent container beside application container.
105
97
  For that case, pass `AWS_XRAY_LOCATION` environment variable to container to specify host and port of xray agent.
106
98
 
107
- ```
99
+ ```bash
108
100
  docker run --link xray:xray --env AWS_XRAY_LOCATION=xray:2000 my-application
109
101
  ```
110
102
 
@@ -134,13 +126,13 @@ Aws::Xray.config.default_annotation = Aws::Xray.config.default_annotation.merge(
134
126
 
135
127
  Keys must be alphanumeric characters with underscore and values must be one of String or Integer or Boolean values.
136
128
 
137
- For meta data:
129
+ For metadata:
138
130
 
139
131
  ```ruby
140
132
  Aws::Xray.config.default_metadata = Aws::Xray.config.default_metadata.merge(key: ['some', 'meaningful', 'value'])
141
133
  ```
142
134
 
143
- Note: See official document to know what annotation and metadata are in AWS X-Ray.
135
+ Note: See official document about annotation and metadata in AWS X-Ray.
144
136
 
145
137
  ## Development
146
138
 
@@ -1,14 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
- require "aws/xray"
3
+ require 'bundler/setup'
4
+ require 'aws/xray'
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
8
8
 
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
9
+ require 'pry'
10
+ Pry.start
data/bin/setup CHANGED
@@ -4,5 +4,3 @@ IFS=$'\n\t'
4
4
  set -vx
5
5
 
6
6
  bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -7,6 +7,7 @@ module Aws
7
7
  module Xray
8
8
  class Rack
9
9
  TRACE_ENV = 'HTTP_X_AMZN_TRACE_ID'.freeze
10
+ ORIGINAL_TRACE_ENV = 'HTTP_X_AMZN_TRACE_ID_ORIGINAL'.freeze
10
11
 
11
12
  # @param [Hash] client_options For xray-agent client.
12
13
  # - host: e.g. '127.0.0.1'
@@ -37,6 +38,8 @@ module Aws
37
38
  else
38
39
  Trace.generate
39
40
  end
41
+ env[ORIGINAL_TRACE_ENV] = env[TRACE_ENV] # just for the record
42
+ env[TRACE_ENV] = trace.to_header_value
40
43
 
41
44
  Context.with_new_context(@name, @client, trace) do
42
45
  Context.current.base_trace do |seg|
@@ -1,5 +1,5 @@
1
1
  module Aws
2
2
  module Xray
3
- VERSION = '0.9.3'
3
+ VERSION = '0.9.4'
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.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taiki Ono