waterdrop 2.0.7 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/ci.yml +5 -2
- data/.ruby-version +1 -1
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +4 -4
- data/README.md +5 -5
- data/lib/water_drop/instrumentation/callbacks/error.rb +3 -2
- data/lib/water_drop/instrumentation/monitor.rb +1 -3
- data/lib/water_drop/instrumentation/stdout_listener.rb +3 -20
- data/lib/water_drop/producer/buffer.rb +7 -2
- data/lib/water_drop/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a4c3c32e28e4581626a6cf8a10c5dc3aa2dcb72cb3f2517977353c8b6cc4248
|
4
|
+
data.tar.gz: 8d23eb9276f9d5b2138d69542a79403a1a110bd0c02b45e9d11c9e94b7d62fab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 384c1d42739f1e01b22439a85c9adb06fdad444f9b709040e9c87e99adb32ce9aee757ea2c8f7b26b2c22e282a36e6c1f1a48df8b471508967d605e36dc646ef
|
7
|
+
data.tar.gz: bfa16b5ff002e36db5e3b45ba823710b5d0c3eda7e32d8f4666b42661cf6de4807d1000887f91d045a890fca2a6afaa68218439c215557430fa992db8123468c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/.github/workflows/ci.yml
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
name: ci
|
2
2
|
|
3
|
+
concurrency: ci-${{ github.ref }}
|
4
|
+
|
3
5
|
on:
|
4
6
|
pull_request:
|
5
7
|
push:
|
@@ -14,12 +16,13 @@ jobs:
|
|
14
16
|
fail-fast: false
|
15
17
|
matrix:
|
16
18
|
ruby:
|
19
|
+
- '3.1'
|
17
20
|
- '3.0'
|
18
21
|
- '2.7'
|
19
22
|
- '2.6'
|
20
23
|
- 'jruby-9.3.1.0'
|
21
24
|
include:
|
22
|
-
- ruby: '3.
|
25
|
+
- ruby: '3.1'
|
23
26
|
coverage: 'true'
|
24
27
|
steps:
|
25
28
|
- uses: actions/checkout@v2
|
@@ -59,7 +62,7 @@ jobs:
|
|
59
62
|
- name: Set up Ruby
|
60
63
|
uses: ruby/setup-ruby@v1
|
61
64
|
with:
|
62
|
-
ruby-version: 3.
|
65
|
+
ruby-version: 3.1
|
63
66
|
- name: Install latest bundler
|
64
67
|
run: gem install bundler --no-document
|
65
68
|
- name: Install Diffend plugin
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0
|
1
|
+
3.1.0
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# WaterDrop changelog
|
2
2
|
|
3
|
+
## 2.1.0 (2022-01-03)
|
4
|
+
- Ruby 3.1 support
|
5
|
+
- Change the error notification key from `error.emitted` to `error.occurred`.
|
6
|
+
- Normalize error tracking and make all the places publish errors into the same notification endpoint (`error.occurred`).
|
7
|
+
- Start semantic versioning WaterDrop.
|
8
|
+
|
3
9
|
## 2.0.7 (2021-12-03)
|
4
10
|
- Source code metadata url added to the gemspec
|
5
11
|
- Replace `:producer` with `:producer_id` in events and update `StdoutListener` accordingly. This change aligns all the events in terms of not publishing the whole producer object in the events.
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
waterdrop (2.0
|
4
|
+
waterdrop (2.1.0)
|
5
5
|
concurrent-ruby (>= 1.1)
|
6
6
|
dry-configurable (~> 0.13)
|
7
7
|
dry-monitor (~> 0.5)
|
@@ -69,9 +69,9 @@ GEM
|
|
69
69
|
mini_portile2 (2.7.1)
|
70
70
|
minitest (5.14.4)
|
71
71
|
rake (13.0.6)
|
72
|
-
rdkafka (0.11.
|
72
|
+
rdkafka (0.11.1)
|
73
73
|
ffi (~> 1.15)
|
74
|
-
mini_portile2 (~> 2.
|
74
|
+
mini_portile2 (~> 2.6)
|
75
75
|
rake (> 12)
|
76
76
|
rspec (3.10.0)
|
77
77
|
rspec-core (~> 3.10.0)
|
@@ -109,4 +109,4 @@ DEPENDENCIES
|
|
109
109
|
waterdrop!
|
110
110
|
|
111
111
|
BUNDLED WITH
|
112
|
-
2.
|
112
|
+
2.3.4
|
data/README.md
CHANGED
@@ -290,7 +290,7 @@ Note: The metrics returned may not be completely consistent between brokers, top
|
|
290
290
|
|
291
291
|
### Error notifications
|
292
292
|
|
293
|
-
|
293
|
+
WaterDrop allows you to listen to all errors that occur while producing messages and in its internal background threads. Things like reconnecting to Kafka upon network errors and others unrelated to publishing messages are all available under `error.occurred` notification key. You can subscribe to this event to ensure your setup is healthy and without any problems that would otherwise go unnoticed as long as messages are delivered.
|
294
294
|
|
295
295
|
```ruby
|
296
296
|
producer = WaterDrop::Producer.new do |config|
|
@@ -298,10 +298,10 @@ producer = WaterDrop::Producer.new do |config|
|
|
298
298
|
config.kafka = { 'bootstrap.servers': 'localhost:9090' }
|
299
299
|
end
|
300
300
|
|
301
|
-
producer.monitor.subscribe('error.
|
301
|
+
producer.monitor.subscribe('error.occurred') do |event|
|
302
302
|
error = event[:error]
|
303
303
|
|
304
|
-
p "
|
304
|
+
p "WaterDrop error occurred: #{error}"
|
305
305
|
end
|
306
306
|
|
307
307
|
# Run this code without Kafka cluster
|
@@ -313,9 +313,9 @@ end
|
|
313
313
|
|
314
314
|
# After you stop your Kafka cluster, you will see a lot of those:
|
315
315
|
#
|
316
|
-
#
|
316
|
+
# WaterDrop error occurred: Local: Broker transport failure (transport)
|
317
317
|
#
|
318
|
-
#
|
318
|
+
# WaterDrop error occurred: Local: Broker transport failure (transport)
|
319
319
|
```
|
320
320
|
|
321
321
|
### Forking and potential memory problems
|
@@ -24,13 +24,11 @@ module WaterDrop
|
|
24
24
|
messages.buffered
|
25
25
|
|
26
26
|
buffer.flushed_async
|
27
|
-
buffer.flushed_async.error
|
28
27
|
buffer.flushed_sync
|
29
|
-
buffer.flushed_sync.error
|
30
28
|
|
31
29
|
statistics.emitted
|
32
30
|
|
33
|
-
error.
|
31
|
+
error.occurred
|
34
32
|
].freeze
|
35
33
|
|
36
34
|
private_constant :EVENTS
|
@@ -70,15 +70,6 @@ module WaterDrop
|
|
70
70
|
debug(event, messages)
|
71
71
|
end
|
72
72
|
|
73
|
-
# @param event [Dry::Events::Event] event that happened with the details
|
74
|
-
def on_buffer_flushed_async_error(event)
|
75
|
-
messages = event[:messages]
|
76
|
-
error = event[:error]
|
77
|
-
|
78
|
-
error(event, "Async flushing of #{messages.size} failed due to: #{error}")
|
79
|
-
debug(event, messages)
|
80
|
-
end
|
81
|
-
|
82
73
|
# @param event [Dry::Events::Event] event that happened with the details
|
83
74
|
def on_buffer_flushed_sync(event)
|
84
75
|
messages = event[:messages]
|
@@ -87,15 +78,6 @@ module WaterDrop
|
|
87
78
|
debug(event, messages)
|
88
79
|
end
|
89
80
|
|
90
|
-
# @param event [Dry::Events::Event] event that happened with the details
|
91
|
-
def on_buffer_flushed_sync_error(event)
|
92
|
-
messages = event[:dispatched]
|
93
|
-
error = event[:error]
|
94
|
-
|
95
|
-
error(event, "Sync flushing of #{messages.size} failed due to: #{error}")
|
96
|
-
debug(event, messages)
|
97
|
-
end
|
98
|
-
|
99
81
|
# @param event [Dry::Events::Event] event that happened with the details
|
100
82
|
def on_producer_closed(event)
|
101
83
|
info event, 'Closing producer'
|
@@ -103,10 +85,11 @@ module WaterDrop
|
|
103
85
|
end
|
104
86
|
|
105
87
|
# @param event [Dry::Events::Event] event that happened with the error details
|
106
|
-
def
|
88
|
+
def on_error_occurred(event)
|
107
89
|
error = event[:error]
|
90
|
+
type = event[:type]
|
108
91
|
|
109
|
-
error(event, "
|
92
|
+
error(event, "Error occurred: #{error} - #{type}")
|
110
93
|
debug(event, '')
|
111
94
|
end
|
112
95
|
|
@@ -103,8 +103,13 @@ module WaterDrop
|
|
103
103
|
)
|
104
104
|
end
|
105
105
|
rescue *RESCUED_ERRORS => e
|
106
|
-
|
107
|
-
|
106
|
+
@monitor.instrument(
|
107
|
+
'error.occurred',
|
108
|
+
error: e,
|
109
|
+
producer_id: id,
|
110
|
+
dispatched: dispatched,
|
111
|
+
type: sync ? 'buffer.flushed_sync.error' : 'buffer.flush_async.error'
|
112
|
+
)
|
108
113
|
|
109
114
|
raise Errors::FlushFailureError.new(dispatched)
|
110
115
|
end
|
data/lib/water_drop/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: waterdrop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciej Mensfeld
|
@@ -34,7 +34,7 @@ cert_chain:
|
|
34
34
|
R2P11bWoCtr70BsccVrN8jEhzwXngMyI2gVt750Y+dbTu1KgRqZKp/ECe7ZzPzXj
|
35
35
|
pIy9vHxTANKYVyI4qj8OrFdEM5BQNu8oQpL0iQ==
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date:
|
37
|
+
date: 2022-01-03 00:00:00.000000000 Z
|
38
38
|
dependencies:
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: concurrent-ruby
|
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
189
|
- !ruby/object:Gem::Version
|
190
190
|
version: '0'
|
191
191
|
requirements: []
|
192
|
-
rubygems_version: 3.
|
192
|
+
rubygems_version: 3.3.3
|
193
193
|
signing_key:
|
194
194
|
specification_version: 4
|
195
195
|
summary: Kafka messaging made easy!
|
metadata.gz.sig
CHANGED
Binary file
|