aws-xray 0.10.0 → 0.11.0

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: be0cc5b981db59d586eddd5427762402d293ab97
4
- data.tar.gz: 6fc0e7a7856667b32a02f86fd65e82510ad30c43
3
+ metadata.gz: 2e2db1f1c47ffff23ff5b3ba4907d7db96f00ac8
4
+ data.tar.gz: 53a29948b35d186813d7266ce6c4953d4738ea3a
5
5
  SHA512:
6
- metadata.gz: 9294ba8202504a3936ba1dc1fe68dc52a79a3a1762ed6d49e02b310e4965a12ca395f24c9dc0e019a2814df6726f937dc4ff4abe2673665e341e4cfe4f6b8e4e
7
- data.tar.gz: 3d6d58c09af7728a868952ba24b0326016e287deda7d67e20d4ebb81921a6aab29fe1a7b235928d32ba40a23f4043e5ec030807e47801d23bf53b1276bf18758
6
+ metadata.gz: b611a69af5a88fe9aeac5e87cc82b65667b23a465307ad1e48cb1fe69d525675ba7390903548119d5d276db3ead306c0d1802169cb32fd57e02ce3df1c95cbb2
7
+ data.tar.gz: 1ed14d0833d3634882b1283652a98128784994f7d603047ed625e26869cd9aeb76013db6423ac6eaaa7c6ffde89bd291b207fdd7dd383d1de29546b472b285ec
data/README.md CHANGED
@@ -104,7 +104,7 @@ docker run --link xray:xray --env AWS_XRAY_LOCATION=xray:2000 my-application
104
104
  To avoid tracing health checking requests, use "excluded paths" configuration.
105
105
 
106
106
  - Environment variable: `AWS_XRAY_EXCLUDED_PATHS=/health_check,/another_check`
107
- - Global configuration: `Aws::Xray.config.excluded_paths = %w[/health_check /another_check]`
107
+ - Global configuration: `Aws::Xray.config.excluded_paths = ['/health_check', '/another_check', %r{/token/.+}]`
108
108
 
109
109
  ### Recording application version
110
110
  aws-xray automatically tries to set application version by reading `app_root/REVISION` file.
data/lib/aws/xray/rack.rb CHANGED
@@ -12,7 +12,7 @@ module Aws
12
12
  # - host: e.g. '127.0.0.1'
13
13
  # - port: e.g. 2000
14
14
  # - sock: test purpose.
15
- # @param [Array<String>] excluded_paths for health-check endpoints etc...
15
+ # @param [Array<String,Regexp>] excluded_paths for health-check endpoints etc...
16
16
  def initialize(app, client_options: {}, excluded_paths: [])
17
17
  @app = app
18
18
  @name = Aws::Xray.config.name || raise(MissingNameError)
@@ -21,7 +21,7 @@ module Aws
21
21
  end
22
22
 
23
23
  def call(env)
24
- if @excluded_paths.include?(env['PATH_INFO'])
24
+ if excluded_path?(env['PATH_INFO'])
25
25
  @app.call(env)
26
26
  else
27
27
  call_with_tracing(env)
@@ -53,6 +53,10 @@ module Aws
53
53
  Trace.generate
54
54
  end
55
55
  end
56
+
57
+ def excluded_path?(path)
58
+ !!@excluded_paths.find {|p| p === path }
59
+ end
56
60
  end
57
61
  end
58
62
  end
@@ -1,5 +1,5 @@
1
1
  module Aws
2
2
  module Xray
3
- VERSION = '0.10.0'
3
+ VERSION = '0.11.0'
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.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taiki Ono