sbmt-kafka_consumer 3.2.1 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/lib/sbmt/kafka_consumer/base_consumer.rb +5 -1
- data/lib/sbmt/kafka_consumer/client_configurer.rb +1 -1
- data/lib/sbmt/kafka_consumer/instrumentation/yabeda_metrics_listener.rb +9 -0
- data/lib/sbmt/kafka_consumer/version.rb +1 -1
- data/sbmt-kafka_consumer.gemspec +1 -1
- metadata +2 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59edd9a2025974b834689fbccd4e9637c90b217a71a30da14515c99ce6ced9e4
|
4
|
+
data.tar.gz: cb08c1a44da7bf4a508ebeed15318d7ea0eb461482e997fe194b8f14141a1cd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca488baebfdc131c41f9731e1aba206d19c000e657d5fd2b35b04bb0907d70a8f89195761b75076dfca26763f867e1ace2a2a20873db477950ea420151197932
|
7
|
+
data.tar.gz: 3581fe9beed1978490f1786b0b2c6fba3c4416a0b462e12e24e74871937f8c9bff53790f62d944724359dd732009befabd6e9fc410691ad739b92a3ebc59a9e4
|
data/CHANGELOG.md
CHANGED
@@ -13,6 +13,23 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
13
13
|
|
14
14
|
### Fixed
|
15
15
|
|
16
|
+
## [3.3.0] - 2024-09-30
|
17
|
+
|
18
|
+
### Added
|
19
|
+
|
20
|
+
- inheritance of kafka settings for topic
|
21
|
+
|
22
|
+
### Fixed
|
23
|
+
|
24
|
+
- support `karafka 2.4.12`
|
25
|
+
- properly report metrics for consumer offset lag when partition fetch assignment was lost
|
26
|
+
|
27
|
+
## [3.2.2] - 2024-09-23
|
28
|
+
|
29
|
+
### Fixed
|
30
|
+
|
31
|
+
- log OTEL `trace_id`
|
32
|
+
|
16
33
|
## [3.2.1] - 2024-09-20
|
17
34
|
|
18
35
|
### Fixed
|
@@ -162,7 +162,11 @@ module Sbmt
|
|
162
162
|
end
|
163
163
|
|
164
164
|
def trace_id
|
165
|
-
|
165
|
+
return nil unless defined?(::OpenTelemetry)
|
166
|
+
|
167
|
+
context = ::OpenTelemetry::Trace.current_span.context
|
168
|
+
|
169
|
+
context.valid? ? context.hex_trace_id : nil
|
166
170
|
end
|
167
171
|
|
168
172
|
def config
|
@@ -57,7 +57,7 @@ class Sbmt::KafkaConsumer::ClientConfigurer
|
|
57
57
|
manual_offset_management t.manual_offset_management
|
58
58
|
consumer t.consumer.consumer_klass
|
59
59
|
deserializer t.deserializer.instantiate if t.deserializer.klass.present?
|
60
|
-
kafka t.kafka_options if t.kafka_options.present?
|
60
|
+
kafka t.kafka_options.merge(inherit: true) if t.kafka_options.present?
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
@@ -165,6 +165,8 @@ module Sbmt
|
|
165
165
|
offset_lag = partition_statistics["consumer_lag"]
|
166
166
|
next if offset_lag == -1
|
167
167
|
|
168
|
+
next unless partition_owned?(partition_statistics)
|
169
|
+
|
168
170
|
Yabeda.kafka_consumer.offset_lag
|
169
171
|
.set({
|
170
172
|
client: Karafka::App.config.client_id,
|
@@ -180,6 +182,13 @@ module Sbmt
|
|
180
182
|
def time_elapsed_sec(event)
|
181
183
|
(event.payload[:time] || 0) / 1000.0
|
182
184
|
end
|
185
|
+
|
186
|
+
def partition_owned?(partition_statistics)
|
187
|
+
return false if partition_statistics["fetch_state"] == "stopped"
|
188
|
+
return false if partition_statistics["fetch_state"] == "none"
|
189
|
+
|
190
|
+
true
|
191
|
+
end
|
183
192
|
end
|
184
193
|
end
|
185
194
|
end
|
data/sbmt-kafka_consumer.gemspec
CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
33
33
|
|
34
34
|
spec.add_dependency "rails", ">= 6.1"
|
35
35
|
spec.add_dependency "zeitwerk", "~> 2.3"
|
36
|
-
spec.add_dependency "karafka", "~> 2.4"
|
36
|
+
spec.add_dependency "karafka", "~> 2.4"
|
37
37
|
spec.add_dependency "yabeda", ">= 0.11"
|
38
38
|
spec.add_dependency "anyway_config", ">= 2.4.0"
|
39
39
|
spec.add_dependency "thor"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sbmt-kafka_consumer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kuper Ruby-Platform Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -45,9 +45,6 @@ dependencies:
|
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '2.4'
|
48
|
-
- - "<"
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: 2.4.12
|
51
48
|
type: :runtime
|
52
49
|
prerelease: false
|
53
50
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -55,9 +52,6 @@ dependencies:
|
|
55
52
|
- - "~>"
|
56
53
|
- !ruby/object:Gem::Version
|
57
54
|
version: '2.4'
|
58
|
-
- - "<"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 2.4.12
|
61
55
|
- !ruby/object:Gem::Dependency
|
62
56
|
name: yabeda
|
63
57
|
requirement: !ruby/object:Gem::Requirement
|