deimos-ruby 1.23.0 → 1.23.1.pre.beta1
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
- data/lib/deimos/instrumentation.rb +24 -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: 9c224598341cc8695faf62d80522d45afe635f2525b925e2f3fa2feeccf01cdf
|
4
|
+
data.tar.gz: d64aa6015148786db81cccc2f9530d344be9d90a865659d0ccc831f6f36e8627
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 897da7685817910787718de9b8a56684ba9e5a0cdd4ff7bb376e48a6d3fa6955c200c14e98a33de5de855d29192bdc6be47d127a39fe7cf587eebc3d4fec046f
|
7
|
+
data.tar.gz: 7f5f4d66f0d5fe927fd8b8614fcb790c9c585fe73f2ebc48f8190a27c9d2e610f8b63006d9c08eb9161245ac8a94ae4c08b0566e25a7eebf4b443c23e4a638aa
|
@@ -49,28 +49,35 @@ module Deimos
|
|
49
49
|
# @return [void]
|
50
50
|
def self.send_produce_error(event)
|
51
51
|
exception = event.payload[:exception_object]
|
52
|
-
return
|
52
|
+
return unless exception
|
53
53
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
54
|
+
if exception.respond_to?(:failed_messages)
|
55
|
+
messages = exception.failed_messages
|
56
|
+
messages.group_by(&:topic).each do |topic, batch|
|
57
|
+
producer = Deimos::Producer.descendants.find { |c| c.topic == topic }
|
58
|
+
next if batch.empty? || !producer
|
58
59
|
|
59
|
-
|
60
|
-
|
61
|
-
|
60
|
+
decoder = Deimos.schema_backend(schema: producer.config[:schema],
|
61
|
+
namespace: producer.config[:namespace])
|
62
|
+
payloads = batch.map { |m| decoder.decode(m.value) }
|
62
63
|
|
64
|
+
Deimos.config.metrics&.increment(
|
65
|
+
'publish_error',
|
66
|
+
tags: %W(topic:#{topic}),
|
67
|
+
by: payloads.size
|
68
|
+
)
|
69
|
+
Deimos.instrument(
|
70
|
+
'produce_error',
|
71
|
+
producer: producer,
|
72
|
+
topic: topic,
|
73
|
+
exception_object: exception,
|
74
|
+
payloads: payloads
|
75
|
+
)
|
76
|
+
end
|
77
|
+
else
|
63
78
|
Deimos.config.metrics&.increment(
|
64
79
|
'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
|
80
|
+
by: event.respond_to?(:[]) ? event[:message_count] : 1
|
74
81
|
)
|
75
82
|
end
|
76
83
|
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.beta1
|
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:
|