deimos-ruby 1.23.0 → 1.23.1.pre.beta2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78613a211afa5b7bc3f065691e02c1417fb5e91568105bf81c812aabdf2480c4
4
- data.tar.gz: fe640113779b11d13be54be53d434f2865ced8965dafd7493e44c679bb00d704
3
+ metadata.gz: 8eb813b95fd050b52f626abce1487f2fdbe6fcd03525125dbfa73a486a92ea2f
4
+ data.tar.gz: ae81a6229db39885b81b2cb68e53a082f968efdc08c277b068fb4f6bad841e19
5
5
  SHA512:
6
- metadata.gz: ef4de06e3c106abd55703bf5dafa5fa19fa3425b8aca0081704ae1464e1993f94eb9e418b42f609a4b2771133df770b2139a94fddfbfd55ea2c803706124ba6c
7
- data.tar.gz: '028fcf4753d456e552af8ad3dd725f0f4448848f88c8dcee542d503f6ddba7daf1aa8e46d4512e43faadee2f7717e910692479e322fd740f1bdf808a2864a74e'
6
+ metadata.gz: bb5d4e1cdc9b4a481e92d67a2601b64461240d91db4bc695d4adc1a9537d66cd8f752b12c0e6021d991e4f601a0f51790ff14fac99cc0920e0edc495f3d634d3
7
+ data.tar.gz: 1dc7343e4edc13d209822def4a143f97bfbafa03b94abef66e163e5e4c95013a045390a70e120f9752e9193456a0fbc7dc6817bdd1790386cda3863e695ce67a
@@ -48,29 +48,37 @@ module Deimos
48
48
  # @param event [ActiveSupport::Notifications::Event]
49
49
  # @return [void]
50
50
  def self.send_produce_error(event)
51
+ Rails.logger.info(event)
51
52
  exception = event.payload[:exception_object]
52
- return if !exception || !exception.respond_to?(:failed_messages)
53
+ return unless exception
53
54
 
54
- messages = exception.failed_messages
55
- messages.group_by(&:topic).each do |topic, batch|
56
- producer = Deimos::Producer.descendants.find { |c| c.topic == topic }
57
- next if batch.empty? || !producer
55
+ if exception.respond_to?(:failed_messages)
56
+ messages = exception.failed_messages
57
+ messages.group_by(&:topic).each do |topic, batch|
58
+ producer = Deimos::Producer.descendants.find { |c| c.topic == topic }
59
+ next if batch.empty? || !producer
58
60
 
59
- decoder = Deimos.schema_backend(schema: producer.config[:schema],
60
- namespace: producer.config[:namespace])
61
- payloads = batch.map { |m| decoder.decode(m.value) }
61
+ decoder = Deimos.schema_backend(schema: producer.config[:schema],
62
+ namespace: producer.config[:namespace])
63
+ payloads = batch.map { |m| decoder.decode(m.value) }
62
64
 
65
+ Deimos.config.metrics&.increment(
66
+ 'publish_error',
67
+ tags: %W(topic:#{topic}),
68
+ by: payloads.size
69
+ )
70
+ Deimos.instrument(
71
+ 'produce_error',
72
+ producer: producer,
73
+ topic: topic,
74
+ exception_object: exception,
75
+ payloads: payloads
76
+ )
77
+ end
78
+ else
63
79
  Deimos.config.metrics&.increment(
64
80
  'publish_error',
65
- tags: %W(topic:#{topic}),
66
- by: payloads.size
67
- )
68
- Deimos.instrument(
69
- 'produce_error',
70
- producer: producer,
71
- topic: topic,
72
- exception_object: exception,
73
- payloads: payloads
81
+ by: event.respond_to?(:[]) ? event[:message_count] : 1
74
82
  )
75
83
  end
76
84
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deimos
4
- VERSION = '1.23.0'
4
+ VERSION = '1.23.1-beta2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deimos-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.23.0
4
+ version: 1.23.1.pre.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-09 00:00:00.000000000 Z
11
+ date: 2024-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avro_turf
@@ -629,9 +629,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
629
629
  version: '0'
630
630
  required_rubygems_version: !ruby/object:Gem::Requirement
631
631
  requirements:
632
- - - ">="
632
+ - - ">"
633
633
  - !ruby/object:Gem::Version
634
- version: '0'
634
+ version: 1.3.1
635
635
  requirements: []
636
636
  rubygems_version: 3.1.2
637
637
  signing_key: