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 +4 -4
- data/lib/deimos/instrumentation.rb +25 -17
- data/lib/deimos/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8eb813b95fd050b52f626abce1487f2fdbe6fcd03525125dbfa73a486a92ea2f
|
4
|
+
data.tar.gz: ae81a6229db39885b81b2cb68e53a082f968efdc08c277b068fb4f6bad841e19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
53
|
+
return unless exception
|
53
54
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
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
|
-
|
60
|
-
|
61
|
-
|
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
|
-
|
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
|
data/lib/deimos/version.rb
CHANGED
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.
|
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-
|
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:
|
634
|
+
version: 1.3.1
|
635
635
|
requirements: []
|
636
636
|
rubygems_version: 3.1.2
|
637
637
|
signing_key:
|