yes-core 2.4.2 → 2.4.3

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: afba475575e06d43283aa409e9a1669e34e1b4844b89705c5366aa623a4f28b8
4
- data.tar.gz: 4e9d3bf236e962dbcd8bdf34eb75965600a6f837b9b2e4084a8ace4b022bd2c5
3
+ metadata.gz: 70e0c755ba6b965b16e2331495e59061de1ed745c80bcd4cb4d6da4a5e8cdd8b
4
+ data.tar.gz: fe6b3f3e8600ecb1c0558850eef7302d1d938296c391c7539c1caa5de69135d8
5
5
  SHA512:
6
- metadata.gz: 93762a015f86506b49070ebe32691fa27f90ba40bd89eb99ca6bf141a4937638b582e92996a18644019b57327c7951b0072c6d6a37ce83d5fa354ab4800dbe93
7
- data.tar.gz: 7030a6dbcce7208dc3bc46b4c30789b2ca9361e97c8164d710d3cad9210d886793a96ce01a6eb377b2f8e53541a766bc8ddb109e734dbce62bcc13e827b98878
6
+ metadata.gz: 2c0ef42cdb28eb261828d7eb189e03b22fdb154294145aa7966f63fe9ae3f2dcdacef5c6890037ef481420a7460ad02c1f234fcab4c8c1d79a6f1c46529448ee
7
+ data.tar.gz: fa787ad495b279695b2d1100fcf24237630fef1e426e617e0979231442751e8943893d14eaa3a0902d42580bfddd7fdad2b686f0d59e48f353642e9c10531b20
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.4.3] - 2026-09-15
4
+ - See root CHANGELOG.md for details.
5
+
3
6
  ## [2.4.2] - 2026-09-15
4
7
  - See root CHANGELOG.md for details.
5
8
 
@@ -35,6 +35,7 @@ module Yes
35
35
  def call(group_name, payload, guards: true, metadata: nil)
36
36
  prepared = prepare_payload(payload, metadata)
37
37
  cmd = command_utilities.build_group_command(group_name, prepared)
38
+ otl_record_command(cmd)
38
39
  guard_evaluator_class = command_utilities.fetch_guard_evaluator_class_for_group(group_name)
39
40
 
40
41
  ReadModelRecoveryService.check_and_recover_with_retries(read_model, aggregate:) if aggregate.class.read_model_enabled?
@@ -49,6 +50,17 @@ module Yes
49
50
 
50
51
  attr_reader :aggregate, :command_utilities, :read_model
51
52
 
53
+ # Records which command group the span ran; see CommandHandler#otl_record_command.
54
+ #
55
+ # @param cmd [Object] the built command group
56
+ # @return [void]
57
+ def otl_record_command(cmd)
58
+ name = cmd.class.name
59
+ return if name.nil?
60
+
61
+ self.class.current_span&.add_attributes({ CommandHandler::COMMAND_ATTRIBUTE => name })
62
+ end
63
+
52
64
  # Prepares the payload before constructing the group command.
53
65
  # Mirrors the metadata-injection logic in {CommandHandler#prepare_payload}.
54
66
  #
@@ -11,6 +11,10 @@ module Yes
11
11
  # response = handler.call(:approve_documents, { document_ids: '123', another: 'value' })
12
12
  #
13
13
  class CommandHandler
14
+ # Span attribute naming the command that ran. The span keeps a fixed name so its
15
+ # latency histogram stays one series per service; this is how the command is identified.
16
+ COMMAND_ATTRIBUTE = 'command'
17
+
14
18
  include Yes::Core::OpenTelemetry::Trackable
15
19
 
16
20
  # Initializes a new CommandHandler
@@ -32,6 +36,7 @@ module Yes
32
36
  def call(command_name, payload, guards: true, metadata: nil)
33
37
  prepared_payload = prepare_payload(command_name, payload, metadata)
34
38
  cmd = command_utilities.build_command(command_name, prepared_payload)
39
+ otl_record_command(cmd)
35
40
 
36
41
  guard_evaluator_class = command_utilities.fetch_guard_evaluator_class(command_name)
37
42
 
@@ -51,6 +56,18 @@ module Yes
51
56
 
52
57
  attr_reader :aggregate, :command_utilities, :read_model
53
58
 
59
+ # Records which command the span ran. The span itself keeps a fixed name so its latency
60
+ # histogram stays a single series per service; the command goes on an attribute instead.
61
+ #
62
+ # @param cmd [Object] the built command
63
+ # @return [void]
64
+ def otl_record_command(cmd)
65
+ name = cmd.class.name
66
+ return if name.nil?
67
+
68
+ self.class.current_span&.add_attributes({ COMMAND_ATTRIBUTE => name })
69
+ end
70
+
54
71
  # Prepares the command payload
55
72
  #
56
73
  # @param command_name [Symbol] The command name
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Yes
4
4
  module Core
5
- VERSION = '2.4.2'
5
+ VERSION = '2.4.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yes-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.2
4
+ version: 2.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nico Ritsche