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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7dfd28d3152a61cde637263d62515e45dad6b3f67ed45feddb886677f9bdc0c
4
- data.tar.gz: fae636690f466a2e83f81989c5791ba9bc4aeeb6809f2463e00cb200c99b241e
3
+ metadata.gz: 38ed43ffa64552bd34d59a35b041cf9e21645a00fdad969358aad2b368b669ce
4
+ data.tar.gz: 0120a1379df5a3722e1ff6ba364c1686e77790e707289ab2f494fa02eb1dd03c
5
5
  SHA512:
6
- metadata.gz: 5ea1e04a1d153839e8102ab204eec74c8e1ad92adab944fda1a2e2bb5e017fac7352daaf9fa95f05d79ad340dc6e36a148569636e8347998de862cf3e05a6671
7
- data.tar.gz: 8c1fb7172e0280961705f64c950cd442b3d070400d78b5ae7e5b2e69537ecc877f7c5d34e3e03a6cf471755bf4f99d9243bcf2ee37ac4d46dc90d8203857208a
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, resource, attributes)
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, resource: nil, attributes: {}, &block)
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, resource, attributes)
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, resource: nil, attributes: {}, &block)
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(resource || self, name, attributes)
47
+ ::Console.logger.info(self, name, attributes)
48
48
 
49
49
  if block.arity.zero?
50
50
  yield
@@ -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, resource: nil, attributes: nil, &block)
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)
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2021-2025, by Samuel Williams.
5
5
 
6
6
  module Traces
7
- VERSION = "0.16.2"
7
+ VERSION = "0.17.0"
8
8
  end
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
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v0.17.0
4
+
5
+ - Remove support for `resource:` keyword argument with no direct replacement – use an attribute instead.
6
+
3
7
  ## v0.16.0
4
8
 
5
9
  - Introduce `traces:provider:list` command to list all available trace providers.
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.16.2
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.7
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
- ���"1(�hy5Y��<���*niSK' ˾��3oܾ�Ô�S��۞kE�%�fx Wш�6
2
- I��&hs91�mH�&��0Mop@L��E® .���Ϣ�gt����b1�._x
3
- �#nB�#�y������9�ڂ��]��YN)~�!o.TB��sw$�a2" ����d�2Q�p�؃{E�h3�-��$F�Q+T 3͗;�$�J�� m�j���~�T=�C%ж����"Ja���䬻�\V��dy(��J,˭�7Ę�g�7�ꪴm{��ܤ��fΰ/� Dȥ���7@xo���:5B����W{{-V��(d
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
+ &��뾾Hd��gq���5Y���]�E����/^m�/Z4��7ʔ�ɪ�K�A�8��ܒ)
3
+ �c��㾞=+a)���b`P��c��|\hxӹ �c��D�ք`����d� T��K?�B�Ucrh^��b.��g�٬{>;���毡��� b#��i­x5f��P��e���g����$�=��� l϶Fȝ}$� @?�#�