waterdrop 2.0.6 → 2.0.7

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: b2effa3419e6eb9a94cf46d6ccfde35ec3dd0579d60e679445436e792e1a30cb
4
- data.tar.gz: 79aa906b30e78fa183cdb8a37df6c5fc0e4e7a599e350376eb34849d07f094df
3
+ metadata.gz: 261d7b8295e2e1b3a6b9658d4409dc58ff8c336e8e5d6064e80d92c8e3215bbe
4
+ data.tar.gz: f67bad60fe2cd37ac1658533ceec0daa1ec9ab527bb022da7f1cc40ccde89088
5
5
  SHA512:
6
- metadata.gz: 588b5f7ec397830a422e42b0d37cd189952f6648761c9cc93d3c50bd664d3f502e0775f731fabc1925fca1ae651c90ce3d3c96aeadc7de3edb79c5155c152211
7
- data.tar.gz: b94efadeb84cc4033d5b08aeac372f92a2cb7fac8df4e58df62dca55535a152afa9d7078433841b17dd8906a6588ed90110d22cf9dcad9915b659367015be1f2
6
+ metadata.gz: e0529057c22d4b76c61f788f038e8fb024785aa3a2c89c266cfe2b50d1f2b44e8a96e16ca626f62e721d4ae48fe4afac7113e32e5cd5ccbc5e7adf36aa0558af
7
+ data.tar.gz: 31241cad722c315aefab9d4ad2613908f053bf3c905779e8fe5c6f1975fbc866b34526442386c1faec2e2386d5f5332c4b7e80a326aa8aca9b8ab1b94e51d572
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # WaterDrop changelog
2
2
 
3
+ ## 2.0.7 (2021-12-03)
4
+ - Source code metadata url added to the gemspec
5
+ - 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.
6
+ - Add `error.emitted` into the `StdoutListener`.
7
+ - Enable `StdoutLogger` in specs for additional integration coverage.
8
+
3
9
  ## 2.0.6 (2021-12-01)
4
10
  - #218 - Fixes a case, where dispatch of callbacks the same moment a new producer was created could cause a concurrency issue in the manager.
5
11
  - Fix some unstable specs.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- waterdrop (2.0.6)
4
+ waterdrop (2.0.7)
5
5
  concurrent-ruby (>= 1.1)
6
6
  dry-configurable (~> 0.13)
7
7
  dry-monitor (~> 0.5)
@@ -17,7 +17,8 @@ module WaterDrop
17
17
  # WaterDrop options
18
18
  #
19
19
  # option [String] id of the producer. This can be helpful when building producer specific
20
- # instrumentation or loggers. It is not the kafka producer id
20
+ # instrumentation or loggers. It is not the kafka client id. It is an id that should be
21
+ # unique for each of the producers
21
22
  setting(
22
23
  :id,
23
24
  default: false,
@@ -17,7 +17,7 @@ module WaterDrop
17
17
  # Runs the instrumentation monitor with error
18
18
  # @param client_name [String] rdkafka client name
19
19
  # @param error [Rdkafka::Error] error that occurred
20
- # @note If will only instrument on errors of the client of our producer
20
+ # @note It will only instrument on errors of the client of our producer
21
21
  def call(client_name, error)
22
22
  # Emit only errors related to our client
23
23
  # Same as with statistics (mor explanation there)
@@ -51,7 +51,7 @@ module WaterDrop
51
51
  message = event[:message]
52
52
 
53
53
  info(event, "Buffering of a message to '#{message[:topic]}' topic")
54
- debug(event, [message, event[:producer].messages.size])
54
+ debug(event, [message])
55
55
  end
56
56
 
57
57
  # @param event [Dry::Events::Event] event that happened with the details
@@ -59,7 +59,7 @@ module WaterDrop
59
59
  messages = event[:messages]
60
60
 
61
61
  info(event, "Buffering of #{messages.size} messages")
62
- debug(event, [messages, event[:producer].messages.size])
62
+ debug(event, [messages, messages.size])
63
63
  end
64
64
 
65
65
  # @param event [Dry::Events::Event] event that happened with the details
@@ -99,7 +99,15 @@ module WaterDrop
99
99
  # @param event [Dry::Events::Event] event that happened with the details
100
100
  def on_producer_closed(event)
101
101
  info event, 'Closing producer'
102
- debug event, event[:producer].messages.size
102
+ debug event, ''
103
+ end
104
+
105
+ # @param event [Dry::Events::Event] event that happened with the error details
106
+ def on_error_emitted(event)
107
+ error = event[:error]
108
+
109
+ error(event, "Background thread error emitted: #{error}")
110
+ debug(event, '')
103
111
  end
104
112
 
105
113
  private
@@ -107,19 +115,19 @@ module WaterDrop
107
115
  # @param event [Dry::Events::Event] event that happened with the details
108
116
  # @param log_message [String] message we want to publish
109
117
  def debug(event, log_message)
110
- @logger.debug("[#{event[:producer].id}] #{log_message}")
118
+ @logger.debug("[#{event[:producer_id]}] #{log_message}")
111
119
  end
112
120
 
113
121
  # @param event [Dry::Events::Event] event that happened with the details
114
122
  # @param log_message [String] message we want to publish
115
123
  def info(event, log_message)
116
- @logger.info("[#{event[:producer].id}] #{log_message} took #{event[:time]} ms")
124
+ @logger.info("[#{event[:producer_id]}] #{log_message} took #{event[:time]} ms")
117
125
  end
118
126
 
119
127
  # @param event [Dry::Events::Event] event that happened with the details
120
128
  # @param log_message [String] message we want to publish
121
129
  def error(event, log_message)
122
- @logger.error("[#{event[:producer].id}] #{log_message}")
130
+ @logger.error("[#{event[:producer_id]}] #{log_message}")
123
131
  end
124
132
  end
125
133
  end
@@ -19,7 +19,7 @@ module WaterDrop
19
19
 
20
20
  @monitor.instrument(
21
21
  'message.produced_async',
22
- producer: self,
22
+ producer_id: id,
23
23
  message: message
24
24
  ) { client.produce(**message) }
25
25
  end
@@ -40,7 +40,7 @@ module WaterDrop
40
40
 
41
41
  @monitor.instrument(
42
42
  'messages.produced_async',
43
- producer: self,
43
+ producer_id: id,
44
44
  messages: messages
45
45
  ) do
46
46
  messages.map { |message| client.produce(**message) }
@@ -23,7 +23,7 @@ module WaterDrop
23
23
 
24
24
  @monitor.instrument(
25
25
  'message.buffered',
26
- producer: self,
26
+ producer_id: id,
27
27
  message: message
28
28
  ) { @messages << message }
29
29
  end
@@ -40,7 +40,7 @@ module WaterDrop
40
40
 
41
41
  @monitor.instrument(
42
42
  'messages.buffered',
43
- producer: self,
43
+ producer_id: id,
44
44
  messages: messages
45
45
  ) do
46
46
  messages.each { |message| @messages << message }
@@ -56,7 +56,7 @@ module WaterDrop
56
56
 
57
57
  @monitor.instrument(
58
58
  'buffer.flushed_async',
59
- producer: self,
59
+ producer_id: id,
60
60
  messages: @messages
61
61
  ) { flush(false) }
62
62
  end
@@ -69,7 +69,7 @@ module WaterDrop
69
69
 
70
70
  @monitor.instrument(
71
71
  'buffer.flushed_sync',
72
- producer: self,
72
+ producer_id: id,
73
73
  messages: @messages
74
74
  ) { flush(true) }
75
75
  end
@@ -104,7 +104,7 @@ module WaterDrop
104
104
  end
105
105
  rescue *RESCUED_ERRORS => e
106
106
  key = sync ? 'buffer.flushed_sync.error' : 'buffer.flush_async.error'
107
- @monitor.instrument(key, producer: self, error: e, dispatched: dispatched)
107
+ @monitor.instrument(key, producer_id: id, error: e, dispatched: dispatched)
108
108
 
109
109
  raise Errors::FlushFailureError.new(dispatched)
110
110
  end
@@ -21,7 +21,7 @@ module WaterDrop
21
21
 
22
22
  @monitor.instrument(
23
23
  'message.produced_sync',
24
- producer: self,
24
+ producer_id: id,
25
25
  message: message
26
26
  ) do
27
27
  client
@@ -49,7 +49,7 @@ module WaterDrop
49
49
  ensure_active!
50
50
  messages.each { |message| validate_message!(message) }
51
51
 
52
- @monitor.instrument('messages.produced_sync', producer: self, messages: messages) do
52
+ @monitor.instrument('messages.produced_sync', producer_id: id, messages: messages) do
53
53
  messages
54
54
  .map { |message| client.produce(**message) }
55
55
  .map! do |handler|
@@ -106,7 +106,7 @@ module WaterDrop
106
106
 
107
107
  @monitor.instrument(
108
108
  'producer.closed',
109
- producer: self
109
+ producer_id: id
110
110
  ) do
111
111
  @status.closing!
112
112
 
@@ -3,5 +3,5 @@
3
3
  # WaterDrop library
4
4
  module WaterDrop
5
5
  # Current WaterDrop version
6
- VERSION = '2.0.6'
6
+ VERSION = '2.0.7'
7
7
  end
data/waterdrop.gemspec CHANGED
@@ -33,4 +33,5 @@ Gem::Specification.new do |spec|
33
33
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
34
34
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
35
35
  spec.require_paths = %w[lib]
36
+ spec.metadata = { 'source_code_uri' => 'https://github.com/karafka/waterdrop' }
36
37
  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.6
4
+ version: 2.0.7
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-01 00:00:00.000000000 Z
37
+ date: 2021-12-03 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: concurrent-ruby
@@ -172,7 +172,8 @@ files:
172
172
  homepage: https://karafka.io
173
173
  licenses:
174
174
  - MIT
175
- metadata: {}
175
+ metadata:
176
+ source_code_uri: https://github.com/karafka/waterdrop
176
177
  post_install_message:
177
178
  rdoc_options: []
178
179
  require_paths:
metadata.gz.sig CHANGED
Binary file