karafka-web 0.2.3 → 0.2.4

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: '069037558ca061c8dd11c4fd48658699814f9904668463a957c7fabeff16fb4c'
4
- data.tar.gz: 7627bf19b437d6b9e040c7d164a615d6cfcf0777d0294bb5958e4ea8b8e8a20c
3
+ metadata.gz: b03937826882f0a85bbd1718f2b09411148ec9647ab46d0d9a9701c278a07b66
4
+ data.tar.gz: 257bbf154f1d19aaaecd7150105ecd7233aa33f8bd42c4195a938c215061220b
5
5
  SHA512:
6
- metadata.gz: 2bbd71a7eb35f534dbd262089651aaa241b481b44cd7e9841954571f47d7c8737c0f9c8dd14f479fec5d8b80315f5317c9177ca4c1a11689b8e973541a9107c4
7
- data.tar.gz: 4b5100c7fb244bb53e5590b94cf16ef98203295944ffffb44f5e29af912848608e0d514d4eeaca0f47ff9aee85cb86e17712f79ceb698eccd96ea9ddf070fa4d
6
+ metadata.gz: 1aed9e94d037cd9bdaa07e55f96281f83dc18ebe151ec4a7f936e1592ac9d530a45fbb45dbd7c5d843692ede58bbca5d1d81a63974e222b0649cd0aa6bd8a9b6
7
+ data.tar.gz: 4ce6deaac3737bb8d25952158ac2b022621187bb8b0d42f952261b831d664e21cf5e12ff15bbccc054927a0b9dd000f75361270adeb3cb6708df93144b848d08
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Karafka Web changelog
2
2
 
3
+ ## 0.2.4 (2023-03-14)
4
+ - [Improvement] Paginate topics list in cluster info on every 100 partitions.
5
+ - [Improvement] Provide current page in the pagination.
6
+ - [Improvement] Report usage of Karafka Pro on the status page view.
7
+ - [Fix] Add missing three months limit on errors storage.
8
+ - [Maintenance] Exclude Karafka Web UI topics from declarative topics.
9
+
3
10
  ## 0.2.3 (2023-03-04)
4
11
  - [Improvement] Snapshot current consumer tags upon consumer errors.
5
12
  - [Improvement] Optimize exception message extraction from errors.
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-web (0.2.3)
4
+ karafka-web (0.2.4)
5
5
  erubi (~> 1.4)
6
- karafka (>= 2.0.33, < 3.0.0)
6
+ karafka (>= 2.0.35, < 3.0.0)
7
7
  karafka-core (>= 2.0.12, < 3.0.0)
8
8
  roda (~> 3.63)
9
9
  tilt (~> 2.0)
@@ -26,7 +26,7 @@ GEM
26
26
  ffi (1.15.5)
27
27
  i18n (1.12.0)
28
28
  concurrent-ruby (~> 1.0)
29
- karafka (2.0.33)
29
+ karafka (2.0.35)
30
30
  karafka-core (>= 2.0.12, < 3.0.0)
31
31
  thor (>= 0.20)
32
32
  waterdrop (>= 2.4.10, < 3.0.0)
data/karafka-web.gemspec CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.licenses = %w[LGPL-3.0 Commercial]
18
18
 
19
19
  spec.add_dependency 'erubi', '~> 1.4'
20
- spec.add_dependency 'karafka', '>= 2.0.33', '< 3.0.0'
20
+ spec.add_dependency 'karafka', '>= 2.0.35', '< 3.0.0'
21
21
  spec.add_dependency 'karafka-core', '>= 2.0.12', '< 3.0.0'
22
22
  spec.add_dependency 'roda', '~> 3.63'
23
23
  spec.add_dependency 'tilt', '~> 2.0'
@@ -45,6 +45,7 @@ module Karafka
45
45
  consumer_group ::Karafka::Web.config.processing.consumer_group do
46
46
  # Topic we listen on to materialize the states
47
47
  topic ::Karafka::Web.config.topics.consumers.reports do
48
+ config(active: false)
48
49
  active ::Karafka::Web.config.processing.active
49
50
  # Since we materialize state in intervals, we can poll for half of this time without
50
51
  # impacting the reporting responsiveness
@@ -58,11 +59,13 @@ module Karafka
58
59
  # We define those two here without consumption, so Web understands how to deserialize
59
60
  # them when used / viewed
60
61
  topic ::Karafka::Web.config.topics.consumers.states do
62
+ config(active: false)
61
63
  active false
62
64
  deserializer web_deserializer
63
65
  end
64
66
 
65
67
  topic ::Karafka::Web.config.topics.errors do
68
+ config(active: false)
66
69
  active false
67
70
  deserializer web_deserializer
68
71
  end
@@ -126,7 +129,9 @@ module Karafka
126
129
  ::Karafka::Admin.create_topic(
127
130
  errors_topic,
128
131
  1,
129
- replication_factor
132
+ replication_factor,
133
+ # Remove really old errors (older than 3 months just to preserve space)
134
+ { 'retention.ms': 3 * 31 * 24 * 60 * 60 * 1_000 }
130
135
  )
131
136
  end
132
137
  end
@@ -10,13 +10,33 @@ module Karafka
10
10
  def index
11
11
  @cluster_info = Karafka::Admin.cluster_info
12
12
 
13
- @topics = @cluster_info
14
- .topics
15
- .reject { |topic| topic[:topic_name] == '__consumer_offsets' }
16
- .sort_by { |topic| topic[:topic_name] }
13
+ partitions_total = []
14
+
15
+ displayable_topics(@cluster_info).each do |topic|
16
+ topic[:partitions].each do |partition|
17
+ partitions_total << partition.merge(topic: topic)
18
+ end
19
+ end
20
+
21
+ @partitions, @next_page = Ui::Lib::PaginateArray.new.call(
22
+ partitions_total,
23
+ @params.current_page
24
+ )
17
25
 
18
26
  respond
19
27
  end
28
+
29
+ private
30
+
31
+ # @param cluster_info [Rdkafka::Metadata] cluster metadata
32
+ # @return [Array<Hash>] array with topics to be displayed sorted in an alphabetical
33
+ # order
34
+ def displayable_topics(cluster_info)
35
+ cluster_info
36
+ .topics
37
+ .reject { |topic| topic[:topic_name] == '__consumer_offsets' }
38
+ .sort_by { |topic| topic[:topic_name] }
39
+ end
20
40
  end
21
41
  end
22
42
  end
@@ -118,6 +118,22 @@ module Karafka
118
118
  )
119
119
  end
120
120
 
121
+ # @return [Status::Step] is Pro enabled with all of its features.
122
+ # @note It's not an error not to have it but we want to warn, that some of the features
123
+ # may not work without Pro.
124
+ def pro_subscription
125
+ status = if state_calculation.success?
126
+ ::Karafka.pro? ? :success : :warning
127
+ else
128
+ :halted
129
+ end
130
+
131
+ Step.new(
132
+ status,
133
+ nil
134
+ )
135
+ end
136
+
121
137
  private
122
138
 
123
139
  # @return [String] consumers states topic name
@@ -1,3 +1,5 @@
1
+ <% topic = partition[:topic] %>
2
+
1
3
  <% if topic[:topic_name] != '__consumer_offsets' %>
2
4
  <tr>
3
5
  <td>
@@ -56,15 +56,12 @@
56
56
  </tr>
57
57
  </thead>
58
58
  <tbody>
59
- <% @topics.each do |topic| %>
60
- <%==
61
- each_partial(
62
- topic[:partitions],
63
- 'cluster/partition',
64
- locals: { topic: topic }
65
- )
66
- %>
67
- <% end %>
59
+ <%==
60
+ each_partial(
61
+ @partitions,
62
+ 'cluster/partition'
63
+ )
64
+ %>
68
65
  </tbody>
69
66
  </table>
70
67
  </div>
@@ -9,6 +9,12 @@
9
9
  </a>
10
10
  </li>
11
11
 
12
+ <li class="page-item active disabled">
13
+ <a class="page-link" href="<%= current_path(page: @current_page) %>">
14
+ <span><%= @current_page %></span>
15
+ </a>
16
+ </li>
17
+
12
18
  <li class="page-item <%= 'disabled' unless @next_page %>">
13
19
  <a class="page-link" href="<%= current_path(page: @next_page) %>">
14
20
  <span>Next &raquo;</span>
@@ -0,0 +1,14 @@
1
+ <div class="card border-warning mb-3">
2
+ <div class="card-header text-bg-warning">
3
+ <span>
4
+ <%= title %>
5
+ </span>
6
+
7
+ <span class="float-end">
8
+ <span class="badge text-bg-light">Warning</span>
9
+ </span>
10
+ </div>
11
+ <div class="card-body">
12
+ <%== description %>
13
+ </div>
14
+ </div>
@@ -89,6 +89,21 @@
89
89
  )
90
90
  %>
91
91
 
92
+ <%==
93
+ partial(
94
+ "status/#{@status.pro_subscription.to_s}",
95
+ locals: {
96
+ title: 'Karafka Pro subscription',
97
+ description: partial(
98
+ 'status/warnings/pro_subscription',
99
+ locals: {
100
+ details: @status.pro_subscription.details
101
+ }
102
+ )
103
+ }
104
+ )
105
+ %>
106
+
92
107
  </div>
93
108
  </div>
94
109
  </div>
@@ -0,0 +1,9 @@
1
+ <p>
2
+ You are using the OSS version of the Karafka ecosystem, and some of the Karafka ecosystem features are unavailable in the OSS version.
3
+ </p>
4
+
5
+ <p class="mb-0">
6
+ Please help us make the Karafka ecosystem better by subscribing to our
7
+ <a target="_blank" href="https://karafka.io/#become-pro">Pro</a>
8
+ offering.
9
+ </p>
@@ -3,6 +3,6 @@
3
3
  module Karafka
4
4
  module Web
5
5
  # Current gem version
6
- VERSION = '0.2.3'
6
+ VERSION = '0.2.4'
7
7
  end
8
8
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -35,7 +35,7 @@ cert_chain:
35
35
  Qf04B9ceLUaC4fPVEz10FyobjaFoY4i32xRto3XnrzeAgfEe4swLq8bQsR3w/EF3
36
36
  MGU0FeSV2Yj7Xc2x/7BzLK8xQn5l7Yy75iPF+KP3vVmDHnNl
37
37
  -----END CERTIFICATE-----
38
- date: 2023-03-04 00:00:00.000000000 Z
38
+ date: 2023-03-14 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: erubi
@@ -57,7 +57,7 @@ dependencies:
57
57
  requirements:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: 2.0.33
60
+ version: 2.0.35
61
61
  - - "<"
62
62
  - !ruby/object:Gem::Version
63
63
  version: 3.0.0
@@ -67,7 +67,7 @@ dependencies:
67
67
  requirements:
68
68
  - - ">="
69
69
  - !ruby/object:Gem::Version
70
- version: 2.0.33
70
+ version: 2.0.35
71
71
  - - "<"
72
72
  - !ruby/object:Gem::Version
73
73
  version: 3.0.0
@@ -314,6 +314,7 @@ files:
314
314
  - lib/karafka/web/ui/views/status/_failure.erb
315
315
  - lib/karafka/web/ui/views/status/_halted.erb
316
316
  - lib/karafka/web/ui/views/status/_success.erb
317
+ - lib/karafka/web/ui/views/status/_warning.erb
317
318
  - lib/karafka/web/ui/views/status/failures/_connection.erb
318
319
  - lib/karafka/web/ui/views/status/failures/_initial_state.erb
319
320
  - lib/karafka/web/ui/views/status/failures/_live_reporting.erb
@@ -321,6 +322,7 @@ files:
321
322
  - lib/karafka/web/ui/views/status/failures/_state_calculation.erb
322
323
  - lib/karafka/web/ui/views/status/failures/_topics.erb
323
324
  - lib/karafka/web/ui/views/status/show.erb
325
+ - lib/karafka/web/ui/views/status/warnings/_pro_subscription.erb
324
326
  - lib/karafka/web/version.rb
325
327
  homepage: https://karafka.io
326
328
  licenses:
metadata.gz.sig CHANGED
Binary file