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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 261d7b8295e2e1b3a6b9658d4409dc58ff8c336e8e5d6064e80d92c8e3215bbe
4
- data.tar.gz: f67bad60fe2cd37ac1658533ceec0daa1ec9ab527bb022da7f1cc40ccde89088
3
+ metadata.gz: 5a4c3c32e28e4581626a6cf8a10c5dc3aa2dcb72cb3f2517977353c8b6cc4248
4
+ data.tar.gz: 8d23eb9276f9d5b2138d69542a79403a1a110bd0c02b45e9d11c9e94b7d62fab
5
5
  SHA512:
6
- metadata.gz: e0529057c22d4b76c61f788f038e8fb024785aa3a2c89c266cfe2b50d1f2b44e8a96e16ca626f62e721d4ae48fe4afac7113e32e5cd5ccbc5e7adf36aa0558af
7
- data.tar.gz: 31241cad722c315aefab9d4ad2613908f053bf3c905779e8fe5c6f1975fbc866b34526442386c1faec2e2386d5f5332c4b7e80a326aa8aca9b8ab1b94e51d572
6
+ metadata.gz: 384c1d42739f1e01b22439a85c9adb06fdad444f9b709040e9c87e99adb32ce9aee757ea2c8f7b26b2c22e282a36e6c1f1a48df8b471508967d605e36dc646ef
7
+ data.tar.gz: bfa16b5ff002e36db5e3b45ba823710b5d0c3eda7e32d8f4666b42661cf6de4807d1000887f91d045a890fca2a6afaa68218439c215557430fa992db8123468c
checksums.yaml.gz.sig CHANGED
Binary file
@@ -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.0'
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.0
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.2
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.7)
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.0)
72
+ rdkafka (0.11.1)
73
73
  ffi (~> 1.15)
74
- mini_portile2 (~> 2.7)
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.2.31
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
- Aside from errors related to publishing messages like `buffer.flushed_async.error`, WaterDrop allows you to listen to errors that occur in its internal background threads. Things like reconnecting to Kafka upon network errors and others unrelated to publishing messages are all available under `error.emitted` 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.
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.emitted') do |event|
301
+ producer.monitor.subscribe('error.occurred') do |event|
302
302
  error = event[:error]
303
303
 
304
- p "Internal error occurred: #{error}"
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
- # Internal error occurred: Local: Broker transport failure (transport)
316
+ # WaterDrop error occurred: Local: Broker transport failure (transport)
317
317
  #
318
- # Internal error occurred: Local: Broker transport failure (transport)
318
+ # WaterDrop error occurred: Local: Broker transport failure (transport)
319
319
  ```
320
320
 
321
321
  ### Forking and potential memory problems
@@ -24,9 +24,10 @@ module WaterDrop
24
24
  return unless @client_name == client_name
25
25
 
26
26
  @monitor.instrument(
27
- 'error.emitted',
27
+ 'error.occurred',
28
+ error: error,
28
29
  producer_id: @producer_id,
29
- error: error
30
+ type: 'librdkafka.error'
30
31
  )
31
32
  end
32
33
  end
@@ -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.emitted
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 on_error_emitted(event)
88
+ def on_error_occurred(event)
107
89
  error = event[:error]
90
+ type = event[:type]
108
91
 
109
- error(event, "Background thread error emitted: #{error}")
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
- key = sync ? 'buffer.flushed_sync.error' : 'buffer.flush_async.error'
107
- @monitor.instrument(key, producer_id: id, error: e, dispatched: dispatched)
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
@@ -3,5 +3,5 @@
3
3
  # WaterDrop library
4
4
  module WaterDrop
5
5
  # Current WaterDrop version
6
- VERSION = '2.0.7'
6
+ VERSION = '2.1.0'
7
7
  end
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.7
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: 2021-12-03 00:00:00.000000000 Z
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.2.31
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