rack-tracer 0.3.0 → 0.4.0

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: 5d2df76757764d23128ea4fdbc3843878700bfe3
4
- data.tar.gz: 5c433caea14237f01968aa8d1d9d457758128ecf
3
+ metadata.gz: 86a3c63d2d6db8aec7973f1cb60369d557b6b9ab
4
+ data.tar.gz: 37bf5f4419bf129fe3209dd201569ff287d6fff5
5
5
  SHA512:
6
- metadata.gz: 301efdd66dc666f3c540ea8575367c1cc0e6a8bbebd569bdb52a9428821aa66a27a79af33ff7ca4e28fcec481c183134832314e27e45da366d0cfcc25bf122d2
7
- data.tar.gz: 6f27e177f89899cb0649c520f192aaa48b92824bab09473771da08b81813817d8876297eddb7b30e236996c74e2b94d1e4a6c03f0f731acc276462be1d3a5d15
6
+ metadata.gz: c08bb82015ccd64d96048f380736ee1d4b09014c17c83e03b72ff93be014efa5847dd2987dce4c339a0241db77f69dbe0f75dbe462a4db46facacb9b2cc7f423
7
+ data.tar.gz: 53de4aa41e736128324fe05050f71d0473e546313c4fdfabfc168cd82891db182faacb2aa0d581056bb7c5595b4b0b13c3e528813064f30dfa73ed13cd06f48a
data/lib/rack/tracer.rb CHANGED
@@ -13,17 +13,18 @@ module Rack
13
13
  # @param on_start_span [Proc, nil] A callback evaluated after a new span is created.
14
14
  # @param errors [Array<Class>] An array of error classes to be captured by the tracer
15
15
  # as errors. Errors are **not** muted by the middleware, they're re-raised afterwards.
16
- def initialize(app, tracer: OpenTracing.global_tracer, on_start_span: nil, errors: [StandardError])
16
+ def initialize(app, tracer: OpenTracing.global_tracer, on_start_span: nil, trust_incoming_span: true, errors: [StandardError])
17
17
  @app = app
18
18
  @tracer = tracer
19
19
  @on_start_span = on_start_span
20
+ @trust_incoming_span = trust_incoming_span
20
21
  @errors = errors
21
22
  end
22
23
 
23
24
  def call(env)
24
25
  method = env[REQUEST_METHOD]
25
26
 
26
- context = @tracer.extract(OpenTracing::FORMAT_RACK, env)
27
+ context = @tracer.extract(OpenTracing::FORMAT_RACK, env) if @trust_incoming_span
27
28
  span = @tracer.start_span(method,
28
29
  child_of: context,
29
30
  tags: {
data/rack-tracer.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'rack-tracer'
7
- spec.version = '0.3.0'
7
+ spec.version = '0.4.0'
8
8
  spec.authors = ['SaleMove TechMovers']
9
9
  spec.email = ['techmovers@salemove.com']
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-tracer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SaleMove TechMovers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-02 00:00:00.000000000 Z
11
+ date: 2018-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentracing