rack-tracer 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -0
- data/README.md +8 -2
- data/lib/rack/tracer.rb +5 -2
- data/rack-tracer.gemspec +3 -5
- metadata +20 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14e847fe82d881c1a45f7980c3f2b5e7e440f9a8
|
4
|
+
data.tar.gz: 1b12ffdbef6149a5f0ccb469367c0682e28d9a53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b5a2f9c86e512e712f5ee07b130b1ec5b4a1f6dc0de05886dc201ff392c35f92b54c70e1413072ed2c7a8225b58c5d8293062dcaed4909e4b57da82ffecd8fe
|
7
|
+
data.tar.gz: 0c0c5e0084d26ed366d9d31c7803ba82cb4c2a41ee0b0902a2887dfd2af22afe8c2c026ae6cecf79075d4e2f1ee9101f0bfabfac35992d7ae1ca557dbf402c7b
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -23,11 +23,17 @@ You can access the created span using
|
|
23
23
|
env['rack.span']
|
24
24
|
```
|
25
25
|
|
26
|
+
or you can use
|
27
|
+
```ruby
|
28
|
+
OpenTracing.active_span
|
29
|
+
```
|
30
|
+
See [opentracing-ruby](https://github.com/opentracing/opentracing-ruby) for more information how active_span works and what are its limitations.
|
31
|
+
|
26
32
|
You can also add start and finish span callbacks
|
27
33
|
```ruby
|
28
34
|
use Rack::Tracer,
|
29
|
-
on_start_span: ->(span) {
|
30
|
-
on_finish_span: ->(_span) {
|
35
|
+
on_start_span: ->(span) { do_something(span) },
|
36
|
+
on_finish_span: ->(_span) { do_something(span) }
|
31
37
|
```
|
32
38
|
|
33
39
|
## Development
|
data/lib/rack/tracer.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'opentracing'
|
2
4
|
|
3
5
|
module Rack
|
@@ -32,7 +34,7 @@ module Rack
|
|
32
34
|
method = env[REQUEST_METHOD]
|
33
35
|
|
34
36
|
context = @tracer.extract(OpenTracing::FORMAT_RACK, env) if @trust_incoming_span
|
35
|
-
|
37
|
+
scope = @tracer.start_active_span(
|
36
38
|
method,
|
37
39
|
child_of: context,
|
38
40
|
tags: {
|
@@ -43,6 +45,7 @@ module Rack
|
|
43
45
|
'http.uri' => env[REQUEST_URI] # For zipkin, not OT convention
|
44
46
|
}
|
45
47
|
)
|
48
|
+
span = scope.span
|
46
49
|
|
47
50
|
@on_start_span.call(span) if @on_start_span
|
48
51
|
|
@@ -66,7 +69,7 @@ module Rack
|
|
66
69
|
raise
|
67
70
|
ensure
|
68
71
|
begin
|
69
|
-
|
72
|
+
scope.close
|
70
73
|
ensure
|
71
74
|
@on_finish_span.call(span) if @on_finish_span
|
72
75
|
end
|
data/rack-tracer.gemspec
CHANGED
@@ -1,10 +1,9 @@
|
|
1
|
-
|
2
1
|
lib = File.expand_path('lib', __dir__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
|
5
4
|
Gem::Specification.new do |spec|
|
6
5
|
spec.name = 'rack-tracer'
|
7
|
-
spec.version = '0.
|
6
|
+
spec.version = '0.7.0'
|
8
7
|
spec.authors = ['SaleMove TechMovers']
|
9
8
|
spec.email = ['techmovers@salemove.com']
|
10
9
|
|
@@ -18,14 +17,13 @@ Gem::Specification.new do |spec|
|
|
18
17
|
end
|
19
18
|
spec.require_paths = ['lib']
|
20
19
|
|
21
|
-
spec.add_dependency 'opentracing'
|
20
|
+
spec.add_dependency 'opentracing', '~> 0.4'
|
22
21
|
|
23
22
|
spec.add_development_dependency 'bundler', '~> 1.14'
|
23
|
+
spec.add_development_dependency 'opentracing_test_tracer', '~> 0.1'
|
24
24
|
spec.add_development_dependency 'rack', '~> 2.0'
|
25
25
|
spec.add_development_dependency 'rake', '~> 10.0'
|
26
26
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
27
27
|
spec.add_development_dependency 'rubocop', '~> 0.54.0'
|
28
28
|
spec.add_development_dependency 'rubocop-rspec', '~> 1.24.0'
|
29
|
-
spec.add_development_dependency 'test-tracer', '~> 1.0'
|
30
|
-
spec.add_development_dependency 'tracing-matchers', '~> 1.0'
|
31
29
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-tracer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.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: 2018-
|
11
|
+
date: 2018-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentracing
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '0.4'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '0.4'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.14'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: opentracing_test_tracer
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.1'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.1'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rack
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,34 +122,6 @@ dependencies:
|
|
108
122
|
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
124
|
version: 1.24.0
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: test-tracer
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '1.0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '1.0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: tracing-matchers
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '1.0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '1.0'
|
139
125
|
description: ''
|
140
126
|
email:
|
141
127
|
- techmovers@salemove.com
|