traces 0.16.2 → 0.17.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
- checksums.yaml.gz.sig +0 -0
- data/lib/traces/backend/capture.rb +3 -6
- data/lib/traces/backend/console.rb +2 -2
- data/lib/traces/backend/test.rb +1 -4
- data/lib/traces/version.rb +1 -1
- data/readme.md +4 -0
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +3 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38ed43ffa64552bd34d59a35b041cf9e21645a00fdad969358aad2b368b669ce
|
4
|
+
data.tar.gz: 0120a1379df5a3722e1ff6ba364c1686e77790e707289ab2f494fa02eb1dd03c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32e7836b442a5c2740799059a631929f29ea7345ebd86d9a7f567361263b4254d05e9bd97b2fa87fb1ab9e70f558fce5a5f78f510983c8876195d79e9f464298
|
7
|
+
data.tar.gz: 27e0c6d69a3a739985cf4e82f4f0b4f3c23a4c5b754c5bf9d7844bb4cc616229590202f9ad20a93e8eab37707a384961b5b556a9acbd989c5ce09fc1c00d7d19
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -20,16 +20,14 @@ module Traces
|
|
20
20
|
# @parameter name [String] A useful name/annotation for the recorded span.
|
21
21
|
# @parameter resource [String] The "resource" that the span is associated with.
|
22
22
|
# @parameter attributes [Hash] Metadata for the recorded span.
|
23
|
-
def initialize(context, name,
|
23
|
+
def initialize(context, name, attributes)
|
24
24
|
@context = context
|
25
25
|
@name = name
|
26
|
-
@resource = resource
|
27
26
|
@attributes = attributes
|
28
27
|
end
|
29
28
|
|
30
29
|
attr :context
|
31
30
|
attr :name
|
32
|
-
attr :resource
|
33
31
|
attr :attributes
|
34
32
|
|
35
33
|
# Assign some metadata to the span.
|
@@ -43,7 +41,6 @@ module Traces
|
|
43
41
|
def as_json
|
44
42
|
{
|
45
43
|
name: @name,
|
46
|
-
resource: @resource,
|
47
44
|
attributes: @attributes,
|
48
45
|
context: @context.as_json
|
49
46
|
}
|
@@ -65,11 +62,11 @@ module Traces
|
|
65
62
|
# Trace the given block of code and log the execution.
|
66
63
|
# @parameter name [String] A useful name/annotation for the recorded span.
|
67
64
|
# @parameter attributes [Hash] Metadata for the recorded span.
|
68
|
-
def trace(name,
|
65
|
+
def trace(name, attributes: {}, &block)
|
69
66
|
context = Context.nested(Fiber.current.traces_backend_context)
|
70
67
|
Fiber.current.traces_backend_context = context
|
71
68
|
|
72
|
-
span = Span.new(context, name,
|
69
|
+
span = Span.new(context, name, attributes)
|
73
70
|
Capture.spans << span
|
74
71
|
|
75
72
|
yield span
|
@@ -40,11 +40,11 @@ module Traces
|
|
40
40
|
# Trace the given block of code and log the execution.
|
41
41
|
# @parameter name [String] A useful name/annotation for the recorded span.
|
42
42
|
# @parameter attributes [Hash] Metadata for the recorded span.
|
43
|
-
def trace(name,
|
43
|
+
def trace(name, attributes: {}, &block)
|
44
44
|
context = Context.nested(Fiber.current.traces_backend_context)
|
45
45
|
Fiber.current.traces_backend_context = context
|
46
46
|
|
47
|
-
::Console.logger.info(
|
47
|
+
::Console.logger.info(self, name, attributes)
|
48
48
|
|
49
49
|
if block.arity.zero?
|
50
50
|
yield
|
data/lib/traces/backend/test.rb
CHANGED
@@ -46,7 +46,7 @@ module Traces
|
|
46
46
|
# @parameter name [String] A useful name/annotation for the recorded span.
|
47
47
|
# @parameter resource [String] The context in which the trace operation is occuring.
|
48
48
|
# @parameter attributes [Hash] Metadata for the recorded span.
|
49
|
-
def trace(name,
|
49
|
+
def trace(name, attributes: nil, &block)
|
50
50
|
unless block_given?
|
51
51
|
raise ArgumentError, "No block given!"
|
52
52
|
end
|
@@ -55,9 +55,6 @@ module Traces
|
|
55
55
|
raise ArgumentError, "Invalid name (must be String): #{name.inspect}!"
|
56
56
|
end
|
57
57
|
|
58
|
-
# It should be convertable:
|
59
|
-
resource &&= resource.to_s
|
60
|
-
|
61
58
|
context = Context.nested(Fiber.current.traces_backend_context)
|
62
59
|
|
63
60
|
span = Span.new(context)
|
data/lib/traces/version.rb
CHANGED
data/readme.md
CHANGED
@@ -23,6 +23,10 @@ Please see the [project documentation](https://socketry.github.io/traces/) for m
|
|
23
23
|
|
24
24
|
Please see the [project releases](https://socketry.github.io/traces/releases/index) for all releases.
|
25
25
|
|
26
|
+
### v0.17.0
|
27
|
+
|
28
|
+
- Remove support for `resource:` keyword argument with no direct replacement – use an attribute instead.
|
29
|
+
|
26
30
|
### v0.16.0
|
27
31
|
|
28
32
|
- Introduce `traces:provider:list` command to list all available trace providers.
|
data/releases.md
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traces
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
|
-
rubygems_version: 3.6.
|
81
|
+
rubygems_version: 3.6.9
|
82
82
|
specification_version: 4
|
83
83
|
summary: Application instrumentation and tracing.
|
84
84
|
test_files: []
|
metadata.gz.sig
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
���f�
|
5
|
-
�1_K��}�-�)�?�t�Mh����QD�
|
1
|
+
aPw1��~�F��,�>xiL���v��+��l��{�k��v3G6�3��}}]Ύ�U�[��/v��51��c��{3p��39ն�l6U�b�-)��(lcn��ЪR݊�#Em�'�L�]���.�
|
2
|
+
&��뾾H�d��gq���5�Y���]�E����/^m�/Z�4��7ʔ�ɪ�K�A�8��ܒ)
|
3
|
+
�c��㾞=+a)���b`P��c��|\h�xӹ�c��D�ք`����d�T��K?�B�Ucrh^��b.��g�٬{>;���毡��� b#��ix�5f��P��e���g����$�=��� �l϶Fȝ}$� @?�#�
|