rack-tracer 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/rack/tracer.rb +14 -1
- data/rack-tracer.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d2df76757764d23128ea4fdbc3843878700bfe3
|
4
|
+
data.tar.gz: 5c433caea14237f01968aa8d1d9d457758128ecf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 301efdd66dc666f3c540ea8575367c1cc0e6a8bbebd569bdb52a9428821aa66a27a79af33ff7ca4e28fcec481c183134832314e27e45da366d0cfcc25bf122d2
|
7
|
+
data.tar.gz: 6f27e177f89899cb0649c520f192aaa48b92824bab09473771da08b81813817d8876297eddb7b30e236996c74e2b94d1e4a6c03f0f731acc276462be1d3a5d15
|
data/README.md
CHANGED
@@ -36,7 +36,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
36
36
|
|
37
37
|
## Contributing
|
38
38
|
|
39
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
39
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/opentracing-contrib/ruby-rack-tracer.
|
40
40
|
|
41
41
|
|
42
42
|
## License
|
data/lib/rack/tracer.rb
CHANGED
@@ -5,10 +5,19 @@ module Rack
|
|
5
5
|
REQUEST_URI = 'REQUEST_URI'.freeze
|
6
6
|
REQUEST_METHOD = 'REQUEST_METHOD'.freeze
|
7
7
|
|
8
|
-
|
8
|
+
# Create a new Rack Tracer middleware.
|
9
|
+
#
|
10
|
+
# @param app The Rack application/middlewares stack.
|
11
|
+
# @param tracer [OpenTracing::Tracer] A tracer to be used when start_span, and extract
|
12
|
+
# is called.
|
13
|
+
# @param on_start_span [Proc, nil] A callback evaluated after a new span is created.
|
14
|
+
# @param errors [Array<Class>] An array of error classes to be captured by the tracer
|
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])
|
9
17
|
@app = app
|
10
18
|
@tracer = tracer
|
11
19
|
@on_start_span = on_start_span
|
20
|
+
@errors = errors
|
12
21
|
end
|
13
22
|
|
14
23
|
def call(env)
|
@@ -39,6 +48,10 @@ module Rack
|
|
39
48
|
span.set_tag('route', route)
|
40
49
|
end
|
41
50
|
end
|
51
|
+
rescue *@errors => e
|
52
|
+
span.set_tag('error', true)
|
53
|
+
span.log(event: 'error', :'error.object' => e)
|
54
|
+
raise
|
42
55
|
ensure
|
43
56
|
span.finish
|
44
57
|
end
|
data/rack-tracer.gemspec
CHANGED
@@ -4,13 +4,13 @@ $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.
|
7
|
+
spec.version = '0.3.0'
|
8
8
|
spec.authors = ['SaleMove TechMovers']
|
9
9
|
spec.email = ['techmovers@salemove.com']
|
10
10
|
|
11
11
|
spec.summary = %q{Rack OpenTracing middleware}
|
12
12
|
spec.description = %q{}
|
13
|
-
spec.homepage = 'https://github.com/
|
13
|
+
spec.homepage = 'https://github.com/opentracing-contrib/ruby-rack-tracer'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
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.
|
4
|
+
version: 0.3.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-
|
11
|
+
date: 2017-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentracing
|
@@ -112,7 +112,7 @@ files:
|
|
112
112
|
- bin/setup
|
113
113
|
- lib/rack/tracer.rb
|
114
114
|
- rack-tracer.gemspec
|
115
|
-
homepage: https://github.com/
|
115
|
+
homepage: https://github.com/opentracing-contrib/ruby-rack-tracer
|
116
116
|
licenses:
|
117
117
|
- MIT
|
118
118
|
metadata: {}
|
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
version: '0'
|
133
133
|
requirements: []
|
134
134
|
rubyforge_project:
|
135
|
-
rubygems_version: 2.6.
|
135
|
+
rubygems_version: 2.6.11
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: Rack OpenTracing middleware
|