opentracing 0.4.3 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/opentracing/span.rb +2 -2
- data/lib/opentracing/tracer.rb +15 -6
- data/lib/opentracing/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1afd30cdd521cbc991fb90ac3249941cffb92ce520971e9e30def058518f810
|
4
|
+
data.tar.gz: 57d94238f74b7e2e1e24dd6d902848263b1fa043a94eced9df5c176f2a906b2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb204bb822af323dc789bddf74d8acaa182621068358c0b681eaf8210e83e8ed654c53e311a5d867a908bd4c962a591d473be54dd5c5bd983987d1ee498f2018
|
7
|
+
data.tar.gz: d11c2bd895bbf11eda1f85bc01d0b4b90afa25bbdb11a3c99d99971e3ac140786fb8dc2680d2c9da52962cc3c0b959a66c30231107ad083f3e904006fef6c62e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.5.0
|
4
|
+
|
5
|
+
* Tracer#start_span now accepts an optional block. When passed a block, it returns the block's return value, otherwise it returns the newly-created span ([#45](https://github.com/opentracing/opentracing-ruby/pull/45)). See [Issue #13](https://github.com/opentracing/opentracing-ruby/issues/13).
|
6
|
+
|
7
|
+
* When passed an optional block, Tracer#start_active_span returns the block's return value, otherwise it returns the newly-created scope. This is a change in behavior as it previously returned a scope in both cases([#45](https://github.com/opentracing/opentracing-ruby/pull/45)). See [Issue #41](https://github.com/opentracing/opentracing-ruby/issues/41).
|
8
|
+
|
9
|
+
* Improved documentation for `log` and `log_kv` methods ([#44](https://github.com/opentracing/opentracing-ruby/pull/44))
|
10
|
+
|
3
11
|
## 0.4.3
|
4
12
|
|
5
13
|
* Specify versions for development dependencies ([#40](https://github.com/opentracing/opentracing-ruby/pull/40))
|
data/lib/opentracing/span.rb
CHANGED
@@ -46,7 +46,7 @@ module OpenTracing
|
|
46
46
|
# Add a log entry to this span
|
47
47
|
# @param event [String] event name for the log
|
48
48
|
# @param timestamp [Time] time of the log
|
49
|
-
# @param fields [Hash] Additional information to log
|
49
|
+
# @param fields [Hash{Symbol=>Object}] Additional information to log
|
50
50
|
def log(event: nil, timestamp: Time.now, **fields)
|
51
51
|
warn 'Span#log is deprecated. Please use Span#log_kv instead.'
|
52
52
|
nil
|
@@ -54,7 +54,7 @@ module OpenTracing
|
|
54
54
|
|
55
55
|
# Add a log entry to this span
|
56
56
|
# @param timestamp [Time] time of the log
|
57
|
-
# @param fields [Hash] Additional information to log
|
57
|
+
# @param fields [Hash{Symbol=>Object}] Additional information to log
|
58
58
|
def log_kv(timestamp: Time.now, **fields)
|
59
59
|
nil
|
60
60
|
end
|
data/lib/opentracing/tracer.rb
CHANGED
@@ -42,10 +42,12 @@ module OpenTracing
|
|
42
42
|
# References#CHILD_OF reference to the ScopeManager#active.
|
43
43
|
# @param finish_on_close [Boolean] whether span should automatically be
|
44
44
|
# finished when Scope#close is called
|
45
|
-
# @yield [Scope] If an optional block is passed to
|
45
|
+
# @yield [Scope] If an optional block is passed to start_active_span it will
|
46
46
|
# yield the newly-started Scope. If `finish_on_close` is true then the
|
47
47
|
# Span will be finished automatically after the block is executed.
|
48
|
-
# @return [Scope]
|
48
|
+
# @return [Scope, Object] If passed an optional block, start_active_span
|
49
|
+
# returns the block's return value, otherwise it returns the newly-started
|
50
|
+
# and activated Scope
|
49
51
|
def start_active_span(operation_name,
|
50
52
|
child_of: nil,
|
51
53
|
references: nil,
|
@@ -54,7 +56,7 @@ module OpenTracing
|
|
54
56
|
ignore_active_scope: false,
|
55
57
|
finish_on_close: true)
|
56
58
|
Scope::NOOP_INSTANCE.tap do |scope|
|
57
|
-
yield scope if block_given?
|
59
|
+
return yield scope if block_given?
|
58
60
|
end
|
59
61
|
end
|
60
62
|
|
@@ -74,15 +76,22 @@ module OpenTracing
|
|
74
76
|
# @param tags [Hash] Tags to assign to the Span at start time
|
75
77
|
# @param ignore_active_scope [Boolean] whether to create an implicit
|
76
78
|
# References#CHILD_OF reference to the ScopeManager#active.
|
77
|
-
# @
|
78
|
-
#
|
79
|
+
# @yield [Span] If passed an optional block, start_span will yield the
|
80
|
+
# newly-created span to the block. The span will be finished automatically
|
81
|
+
# after the block is executed.
|
82
|
+
# @return [Span, Object] If passed an optional block, start_span will return
|
83
|
+
# the block's return value, otherwise it returns the newly-started Span
|
84
|
+
# instance, which has not been automatically registered via the
|
85
|
+
# ScopeManager
|
79
86
|
def start_span(operation_name,
|
80
87
|
child_of: nil,
|
81
88
|
references: nil,
|
82
89
|
start_time: Time.now,
|
83
90
|
tags: nil,
|
84
91
|
ignore_active_scope: false)
|
85
|
-
Span::NOOP_INSTANCE
|
92
|
+
Span::NOOP_INSTANCE.tap do |span|
|
93
|
+
return yield span if block_given?
|
94
|
+
end
|
86
95
|
end
|
87
96
|
|
88
97
|
# Inject a SpanContext into the given carrier
|
data/lib/opentracing/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentracing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ngauthier
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2019-01-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: minitest
|