zipkin-tracer 0.18.5 → 0.18.6

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: 74b8f0c68905e099c8443f50edbe3c1699aaa84f
4
- data.tar.gz: 310d5a587404e20155402273d390a76fcbc8dec7
3
+ metadata.gz: 640394dff893e81ed21749a900121b2ba2e4e561
4
+ data.tar.gz: b8c43ed22fedb058687ffe896568bc5b449c60f0
5
5
  SHA512:
6
- metadata.gz: 97e3614ed8b31854cd1ef9114946cac051ff6468487c0b6f4ad88e4690a527e1c55a0d0514a6a1b488bafb8cd32027d70ad0dcdf398dc4e7e14750a295f70c95
7
- data.tar.gz: d4d0bdd07b8a8d4b923a90d0c44eb7c68253d23e3934d02b2124fa298c29c3ecedbdb42c957a68afce51762f4670aac634a84ba64838875120d22408ce1839ff
6
+ metadata.gz: ee7ac9cf049925e4df24488c43878638455bb83d620a0b800f6bcf8b304149b769c726b1fcad33a317b1aed1ac1ef73a701f158ced48b6845f4b6b6f8ad124c9
7
+ data.tar.gz: 7df178c307215876cae40df7d8ade1e67676bf1c58c68a105f6bb2542a1048e6de71d584eeae5f9a40b420250ee3f77ccfeccc718f9630628cf20c626ecee7f6
@@ -3,9 +3,9 @@ module ZipkinTracer
3
3
  # Useful methods on the Application we are instrumenting
4
4
  class Application
5
5
  # If the request is not valid for this service, we do not what to trace it.
6
- def self.routable_request?(path_info)
6
+ def self.routable_request?(path_info, http_method)
7
7
  return true unless defined?(Rails) # If not running on a Rails app, we can't verify if it is invalid
8
- Rails.application.routes.recognize_path(path_info)
8
+ Rails.application.routes.recognize_path(path_info, method: http_method)
9
9
  true
10
10
  rescue ActionController::RoutingError
11
11
  false
@@ -34,7 +34,7 @@ module ZipkinTracer
34
34
  zipkin_env = ZipkinEnv.new(env, @config)
35
35
  trace_id = zipkin_env.trace_id
36
36
  Trace.with_trace_id(trace_id) do
37
- if !trace_id.sampled? || !Application.routable_request?(env['PATH_INFO'])
37
+ if !trace_id.sampled? || !routable_request?(env)
38
38
  @app.call(env)
39
39
  else
40
40
  @tracer.with_new_span(trace_id, zipkin_env.env['REQUEST_METHOD'].to_s.downcase) do |span|
@@ -46,6 +46,10 @@ module ZipkinTracer
46
46
 
47
47
  private
48
48
 
49
+ def routable_request?(env)
50
+ Application.routable_request?(env['PATH_INFO'], env['REQUEST_METHOD'])
51
+ end
52
+
49
53
  def annotate_plugin(env, status, response_headers, response_body)
50
54
  @config.annotate_plugin.call(env, status, response_headers, response_body) if @config.annotate_plugin
51
55
  end
@@ -12,5 +12,5 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
  module ZipkinTracer
15
- VERSION = '0.18.5'.freeze
15
+ VERSION = '0.18.6'.freeze
16
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zipkin-tracer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.5
4
+ version: 0.18.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franklin Hu
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2016-11-15 00:00:00.000000000 Z
16
+ date: 2016-11-21 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: faraday