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 +4 -4
- data/lib/zipkin-tracer/application.rb +2 -2
- data/lib/zipkin-tracer/rack/zipkin-tracer.rb +5 -1
- data/lib/zipkin-tracer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 640394dff893e81ed21749a900121b2ba2e4e561
|
4
|
+
data.tar.gz: b8c43ed22fedb058687ffe896568bc5b449c60f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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? || !
|
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
|
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.
|
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-
|
16
|
+
date: 2016-11-21 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: faraday
|