protobuf-opentracing 1.0.1 → 1.0.2.pre

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
  SHA256:
3
- metadata.gz: ba46382e175568ef4fb9659969e9815c4297106c3dd7ded16dab26db71a1f735
4
- data.tar.gz: bc86bdf97410e171c6b95956ebfbe78de877ce0b745765a05aab5cc81b80dfc8
3
+ metadata.gz: 91a61883893c1e7326f9cd14659ab8fd8bfc156db13b7d557e006a1d1b8ba761
4
+ data.tar.gz: f316c35a5e05e0990886755cc18a4a4e66cbb844aff6e68bf65df15793c7a339
5
5
  SHA512:
6
- metadata.gz: f4ca63dd32351de5aeb6b25d7ff8590a8bbbaaeb9874ca24c3bb0a39a48876908dd7ac682ef1922eca65183272aa3fe1e750e7a286399a59673c13b863a7fb2a
7
- data.tar.gz: 514210d90269d8b4cad7bd983cf75bcd215576b6a654618f766540517871aa6bc574dc741641ebc022741104300a3d6c22e8229e4a1e0474946f973b6e985a85
6
+ metadata.gz: 4d2a604be03cf0362593d5b779860e82726c0a92bafc6882ebd27124ee1be00b73d160a3c39d4336f1b4afe1465399c528760586af5fdcc6622731fc597c8184
7
+ data.tar.gz: 411678399ce00c5b6b4432b60600bc80a750379f75cc45a41368fcd3d6ff6003f0fc28f9bc4f67231454a565a91b4b6117d8d70bcd145c41f503de4c61a34441
data/.travis.yml ADDED
@@ -0,0 +1,24 @@
1
+ language: ruby
2
+ rvm:
3
+ - ruby-head
4
+ - ruby-2.5.0
5
+ - jruby-9.1.7.0
6
+
7
+ matrix:
8
+ allow_failures:
9
+ - rvm: ruby-head
10
+
11
+ before_install:
12
+ - sudo apt-get update
13
+ - sudo apt-get install -y unzip
14
+ - gem update --system
15
+ - bundle install
16
+ - wget https://github.com/nats-io/gnatsd/releases/download/v0.9.4/gnatsd-v0.9.4-linux-amd64.zip
17
+ - unzip -p gnatsd-v0.9.4-linux-amd64.zip gnatsd-v0.9.4-linux-amd64/gnatsd > gnatsd
18
+ - chmod +x gnatsd
19
+
20
+ before_script:
21
+ - nohup ./gnatsd --addr 127.0.0.1 --port 4222 &
22
+
23
+ script:
24
+ - bundle exec rake
@@ -1,5 +1,5 @@
1
1
  module Protobuf
2
2
  module Opentracing
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2.pre"
4
4
  end
5
5
  end
@@ -1,13 +1,30 @@
1
1
  require "active_support"
2
+ require "opentracing"
2
3
 
3
- require "protobuf/opentracing/version"
4
4
  require "protobuf/opentracing/request_decoder"
5
+ require "protobuf/opentracing/version"
6
+ require "protobuf/rpc/extensions/base"
7
+ require "protobuf/rpc/extensions/client"
5
8
 
6
9
  module Protobuf
7
10
  module Opentracing
8
11
  end
9
12
  end
10
13
 
14
+ module Protobuf
15
+ module Rpc
16
+ module Connectors
17
+ class Base
18
+ prepend ::Protobuf::Opentracing::Extensions::Base
19
+ end
20
+ end
21
+
22
+ class Client
23
+ prepend ::Protobuf::Opentracing::Extensions::Client
24
+ end
25
+ end
26
+ end
27
+
11
28
  ::ActiveSupport.on_load(:protobuf_rpc_middleware) do |rpc|
12
29
  rpc.middleware.insert_after(::Protobuf::Rpc::Middleware::RequestDecoder, ::Protobuf::Opentracing::RequestDecoder)
13
30
  end
@@ -0,0 +1,26 @@
1
+ module Protobuf
2
+ module Opentracing
3
+ module Extensions
4
+ module Base
5
+ def request_fields
6
+ return super if ::OpenTracing.active_span.nil?
7
+
8
+ trace_carrier = {}
9
+ ::OpenTracing.inject(::OpenTracing.active_span.context,
10
+ ::OpenTracing::FORMAT_TEXT_MAP,
11
+ trace_carrier)
12
+
13
+ trace_headers = trace_carrier.map do |header|
14
+ ::Protobuf::Socketrpc::Header.new(:key => header[0],
15
+ :value => header[1])
16
+ end
17
+
18
+ fields = super
19
+ headers = fields[:headers] || []
20
+ fields[:headers] = headers + trace_headers
21
+ fields
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,14 @@
1
+ module Protobuf
2
+ module Opentracing
3
+ module Extensions
4
+ module Client
5
+ def send_request
6
+ operation = "#{options[:service]}##{options[:method]}"
7
+ ::OpenTracing.start_active_span(operation) do
8
+ super
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -28,8 +28,11 @@ Gem::Specification.new do |spec|
28
28
  spec.add_dependency "activesupport", ">= 3.2", active_support_max_version
29
29
  spec.add_dependency "opentracing"
30
30
 
31
- spec.add_development_dependency "bundler", "~> 1.16"
31
+ spec.add_development_dependency "bundler"
32
+ spec.add_development_dependency "jaeger-client"
32
33
  spec.add_development_dependency "mad_rubocop"
34
+ spec.add_development_dependency "protobuf", "~> 3.10.0"
35
+ spec.add_development_dependency "protobuf-nats"
33
36
  spec.add_development_dependency "pry"
34
37
  spec.add_development_dependency "rake", "~> 10.0"
35
38
  spec.add_development_dependency "rspec", "~> 3.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protobuf-opentracing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcos Minond
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-01 00:00:00.000000000 Z
11
+ date: 2019-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -40,20 +40,62 @@ dependencies:
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: jaeger-client
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: mad_rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: protobuf
43
85
  requirement: !ruby/object:Gem::Requirement
44
86
  requirements:
45
87
  - - "~>"
46
88
  - !ruby/object:Gem::Version
47
- version: '1.16'
89
+ version: 3.10.0
48
90
  type: :development
49
91
  prerelease: false
50
92
  version_requirements: !ruby/object:Gem::Requirement
51
93
  requirements:
52
94
  - - "~>"
53
95
  - !ruby/object:Gem::Version
54
- version: '1.16'
96
+ version: 3.10.0
55
97
  - !ruby/object:Gem::Dependency
56
- name: mad_rubocop
98
+ name: protobuf-nats
57
99
  requirement: !ruby/object:Gem::Requirement
58
100
  requirements:
59
101
  - - ">="
@@ -119,6 +161,7 @@ files:
119
161
  - ".gitlab-ci.yml"
120
162
  - ".rspec"
121
163
  - ".rubocop.yml"
164
+ - ".travis.yml"
122
165
  - Gemfile
123
166
  - LICENSE.txt
124
167
  - README.md
@@ -128,6 +171,8 @@ files:
128
171
  - lib/protobuf/opentracing.rb
129
172
  - lib/protobuf/opentracing/request_decoder.rb
130
173
  - lib/protobuf/opentracing/version.rb
174
+ - lib/protobuf/rpc/extensions/base.rb
175
+ - lib/protobuf/rpc/extensions/client.rb
131
176
  - protobuf-opentracing.gemspec
132
177
  homepage: https://github.com/mxenabled/protobuf-opentracing
133
178
  licenses:
@@ -144,11 +189,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
144
189
  version: '0'
145
190
  required_rubygems_version: !ruby/object:Gem::Requirement
146
191
  requirements:
147
- - - ">="
192
+ - - ">"
148
193
  - !ruby/object:Gem::Version
149
- version: '0'
194
+ version: 1.3.1
150
195
  requirements: []
151
- rubygems_version: 3.0.2
196
+ rubyforge_project:
197
+ rubygems_version: 2.7.6
152
198
  signing_key:
153
199
  specification_version: 4
154
200
  summary: Add service to service tracing with Opentracing.