method-tracer 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/method/tracer.rb +6 -4
- data/method-tracer.gemspec +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: dd0175c5c33819bcb2fad315a05ead95537d547c
|
4
|
+
data.tar.gz: bbf3b82b2622235978081645bc5993f5ec70138a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 054b0baed3d88a21b67c7c0d2295723852008338fce65be03bc45a3003e79031f6f0e8019404919200ff2e1e6bd9c0da90c56e942158c57ffee0d2ec6b11acfc
|
7
|
+
data.tar.gz: 614fd5755b77bd9bb5119717b0056601531f6b37e3fae6ebcdb8b3d000aaa9be02bf1cee531c0c5d63be8b37f3e1f1f8b6b3cbb049128a6a076d80b27ef78b0e
|
data/lib/method/tracer.rb
CHANGED
@@ -13,12 +13,12 @@ class Method
|
|
13
13
|
klazz.extend(ClassMethods)
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
16
|
+
def method_tracer
|
17
17
|
@tracer || (raise ConfigError.new("Please configure the tracer using Method::Tracer.configure method"))
|
18
18
|
end
|
19
19
|
|
20
20
|
def active_span
|
21
|
-
@active_span
|
21
|
+
@active_span
|
22
22
|
end
|
23
23
|
|
24
24
|
def configure(tracer: OpenTracing.global_tracer, active_span: nil)
|
@@ -26,8 +26,10 @@ class Method
|
|
26
26
|
@active_span = active_span
|
27
27
|
end
|
28
28
|
|
29
|
-
def trace(operation_name, **args, &block)
|
30
|
-
|
29
|
+
def trace(operation_name, tracer: method_tracer, **args, &block)
|
30
|
+
parent_span = args.include?(:child_of) ? args[:child_of] : active_span
|
31
|
+
args[:child_of] = parent_span.respond_to?(:call) ? parent_span.call : parent_span
|
32
|
+
|
31
33
|
current_span = tracer.start_span(operation_name, **args)
|
32
34
|
|
33
35
|
yield current_span
|
data/method-tracer.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: method-tracer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iaintshine
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentracing
|