karafka-web 0.6.0 → 0.6.1

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: 1f2269efe1b2e14f38c5265d3a8ffd1e7c1bfb1775b11382b27d2cb7a119de03
4
- data.tar.gz: e2656bacf8540ea3854eb0ace8a4e5bf83d3aa7c9e5a7a06d1c36bea50083790
3
+ metadata.gz: 25d9203285a7e2587ec78b57bcde9951c647e5eb026c4c32cd7040bfb844ae88
4
+ data.tar.gz: 46b15b79ebd7b6ce8d9a234c395a6f71bfb7891b8a9cb00d4121fd055bf3f727
5
5
  SHA512:
6
- metadata.gz: 665fdedafab36bb818a64c6aca5ea17355baca597878c0d5819c56c266228d1c8c14135c2dd27a8fb21d81c08d6e7958e9b89c8b21e2b8eac03a93519d8c0b77
7
- data.tar.gz: 6845812a25677375a2d6931785a0ceb8e1d5ac1a454245d924e271aa8993af733b67697aecc055b65feb799c12a337c1e4969024b903b2130d2f5903c6edef3b
6
+ metadata.gz: 529d6eff4eeae68edadd3989cf4e5de9c1c91ea5e0612e2df976717a8700bbbc53e4d917d0421a8e930392b973f19d8a31366be036955392f8ac9a89b821be69
7
+ data.tar.gz: bcd6de8973599bb034733dd2921cff7277f11aab5e735917695e87722049fcf8bf3a4bcdb6e52a86cbcc4c0dfa91d2ebe7f90c9cc9af3f484ae1b0c6a8dbe8a3
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # Karafka Web changelog
2
2
 
3
- ## 0.6.0 (Unreleased)
3
+ ## 0.6.1 (2023-06-25)
4
+ - [Improvement] Include the karafka-web version in the status page tags.
5
+ - [Improvement] Report `karafka-web` version that is running in particular processes.
6
+ - [Improvement] Display `karafka-web` version in the per-process view.
7
+ - [Improvement] Report in the web-ui a scenario, where getting cluster info takes more than 500ms as a warning to make people realize, that operating with Kafka with extensive latencies is not recommended.
8
+ - [Improvement] Continue the status assessment flow on warnings.
9
+ - [Fix] Do not recommend running a server as a way to bootstrap the initial state.
10
+ - [Fix] Ensure in the report contract, that `karafka-core`, `karafka-web`, `rdkafka` and `librdkafka` are validated.
11
+
12
+ ## 0.6.0 (2023-06-13)
4
13
  - **[Feature]** Introduce producers errors tracking.
5
14
  - [Improvement] Display the error origin as a badge to align with consumers view topic assignments.
6
15
  - [Improvement] Collect more job metrics for future usage.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-web (0.6.0)
4
+ karafka-web (0.6.1)
5
5
  erubi (~> 1.4)
6
6
  karafka (>= 2.1.4, < 3.0.0)
7
7
  karafka-core (>= 2.0.13, < 3.0.0)
@@ -12,7 +12,7 @@ module Karafka
12
12
  class Report < Tracking::Contracts::Base
13
13
  configure
14
14
 
15
- required(:schema_version) { |val| val.is_a?(String) }
15
+ required(:schema_version) { |val| val.is_a?(String) && !val.empty? }
16
16
  required(:dispatched_at) { |val| val.is_a?(Numeric) && val.positive? }
17
17
  # We have consumers and producer reports and need to ensure that each is handled
18
18
  # in an expected fashion
@@ -24,7 +24,7 @@ module Karafka
24
24
  required(:memory_usage) { |val| val.is_a?(Integer) && val >= 0 }
25
25
  required(:memory_total_usage) { |val| val.is_a?(Integer) && val >= 0 }
26
26
  required(:memory_size) { |val| val.is_a?(Integer) && val >= 0 }
27
- required(:status) { |val| ::Karafka::Status::STATES.key?(val.to_sym) }
27
+ required(:status) { |val| ::Karafka::Status::STATES.key?(val.to_s.to_sym) }
28
28
  required(:listeners) { |val| val.is_a?(Integer) && val >= 0 }
29
29
  required(:concurrency) { |val| val.is_a?(Integer) && val.positive? }
30
30
  required(:tags) { |val| val.is_a?(Karafka::Core::Taggable::Tags) }
@@ -38,9 +38,13 @@ module Karafka
38
38
  end
39
39
 
40
40
  nested(:versions) do
41
+ required(:ruby) { |val| val.is_a?(String) && !val.empty? }
41
42
  required(:karafka) { |val| val.is_a?(String) && !val.empty? }
43
+ required(:karafka_core) { |val| val.is_a?(String) && !val.empty? }
44
+ required(:karafka_web) { |val| val.is_a?(String) && !val.empty? }
42
45
  required(:waterdrop) { |val| val.is_a?(String) && !val.empty? }
43
- required(:ruby) { |val| val.is_a?(String) && !val.empty? }
46
+ required(:rdkafka) { |val| val.is_a?(String) && !val.empty? }
47
+ required(:librdkafka) { |val| val.is_a?(String) && !val.empty? }
44
48
  end
45
49
 
46
50
  nested(:stats) do
@@ -75,8 +75,9 @@ module Karafka
75
75
  versions: {
76
76
  ruby: ruby_version,
77
77
  karafka: karafka_version,
78
- waterdrop: waterdrop_version,
79
78
  karafka_core: karafka_core_version,
79
+ karafka_web: karafka_web_version,
80
+ waterdrop: waterdrop_version,
80
81
  rdkafka: rdkafka_version,
81
82
  librdkafka: librdkafka_version
82
83
  },
@@ -32,6 +32,11 @@ module Karafka
32
32
  ::Karafka::VERSION
33
33
  end
34
34
 
35
+ # @return [String] Karafka Web UI version
36
+ def karafka_web_version
37
+ ::Karafka::Web::VERSION
38
+ end
39
+
35
40
  # @return [String] Karafka::Core version
36
41
  def karafka_core_version
37
42
  ::Karafka::Core::VERSION
@@ -5,6 +5,7 @@ module Karafka
5
5
  module Ui
6
6
  module Models
7
7
  # Model that represents the general status of the Web UI.
8
+ #
8
9
  # We use this data to display a status page that helps with debugging on what is missing
9
10
  # in the overall setup of the Web UI.
10
11
  #
@@ -15,7 +16,18 @@ module Karafka
15
16
  Step = Struct.new(:status, :details) do
16
17
  # @return [Boolean] is the given step successfully configured and working
17
18
  def success?
18
- status == :success
19
+ status == :success || status == :warning
20
+ end
21
+
22
+ # @return [String] local namespace for partial of a given type
23
+ def partial_namespace
24
+ case status
25
+ when :success then 'successes'
26
+ when :warning then 'warnings'
27
+ when :failure then 'failures'
28
+ else
29
+ raise ::Karafka::Errors::UnsupportedCaseError, status
30
+ end
19
31
  end
20
32
 
21
33
  # @return [String] stringified status
@@ -29,11 +41,21 @@ module Karafka
29
41
  connect
30
42
  end
31
43
 
32
- # @return [Status::Step] were we able to connect to Kafka or not
44
+ # @return [Status::Step] were we able to connect to Kafka or not and how fast.
45
+ # Some people try to work with Kafka over the internet with really high latency and this
46
+ # should be highlighted in the UI as often the connection just becomes unstable
33
47
  def connection
48
+ level = if @connection_time < 1_000
49
+ :success
50
+ elsif @connection_time < 1_000_000
51
+ :warning
52
+ else
53
+ :failure
54
+ end
55
+
34
56
  Step.new(
35
- @connected ? :success : :failure,
36
- nil
57
+ level,
58
+ { time: @connection_time }
37
59
  )
38
60
  end
39
61
 
@@ -171,12 +193,14 @@ module Karafka
171
193
  topics
172
194
  end
173
195
 
174
- # Tries connecting with the cluster and sets the connection state
196
+ # Tries connecting with the cluster and saves the cluster info and the connection time
197
+ # @note If fails, `connection_time` will be 1_000_000
175
198
  def connect
199
+ started = Time.now.to_f
176
200
  @cluster_info = ::Karafka::Admin.cluster_info
177
- @connected = true
201
+ @connection_time = (Time.now.to_f - started) * 1_000
178
202
  rescue ::Rdkafka::RdkafkaError
179
- @connected = false
203
+ @connection_time = 1_000_000
180
204
  end
181
205
  end
182
206
  end
@@ -113,7 +113,12 @@
113
113
  </span>
114
114
 
115
115
  <span class="badge bg-secondary">
116
- karafka core
116
+ karafka-web
117
+ <%= @process.karafka_web %>
118
+ </span>
119
+
120
+ <span class="badge bg-secondary">
121
+ karafka-core
117
122
  <%= @process.karafka_core %>
118
123
  </span>
119
124
 
@@ -7,14 +7,5 @@
7
7
  </p>
8
8
 
9
9
  <p>
10
- To fix this, you can either:
11
- </p>
12
-
13
- <ul>
14
- <li>Run <code>bundle exec karafka-web install</code></li>
15
- <li>Run at least one Karafka consumer process</li>
16
- </ul>
17
-
18
- <p class="mb-0">
19
- Any of the above, when successful, will bootstrap the initial state.
10
+ To fix this, you need to ensure that the <code>bundle exec karafka-web install</code> runs successfully.
20
11
  </p>
@@ -13,7 +13,12 @@
13
13
  </span>
14
14
 
15
15
  <span class="badge bg-secondary">
16
- karafka core
16
+ karafka-web
17
+ <%= @sampler.karafka_web_version %>
18
+ </span>
19
+
20
+ <span class="badge bg-secondary">
21
+ karafka-core
17
22
  <%= @sampler.karafka_core_version %>
18
23
  </span>
19
24
 
@@ -8,7 +8,12 @@
8
8
  "status/#{@status.connection.to_s}",
9
9
  locals: {
10
10
  title: 'Connection to Kafka',
11
- description: partial('status/failures/connection')
11
+ description: partial(
12
+ "status/#{@status.connection.partial_namespace}/connection",
13
+ locals: {
14
+ details: @status.connection.details
15
+ }
16
+ )
12
17
  }
13
18
  )
14
19
  %>
@@ -0,0 +1 @@
1
+ <%# Expected to be empty. No content on success needed. %>
@@ -0,0 +1,11 @@
1
+ <p>
2
+ High latency detected when connecting to the Kafka cluster from the Web-UI.
3
+ </p>
4
+
5
+ <p>
6
+ Kafka is not designed to perform optimally under high network latencies; even when configurations seem appropriate, you may still encounter disconnects and other unexpected issues.
7
+ </p>
8
+
9
+ <p class="mb-0">
10
+ It took Web-UI <strong><%= details[:time].round(2) %> ms</strong> to get the cluster info.
11
+ </p>
@@ -3,6 +3,6 @@
3
3
  module Karafka
4
4
  module Web
5
5
  # Current gem version
6
- VERSION = '0.6.0'
6
+ VERSION = '0.6.1'
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.6.0
4
+ version: 0.6.1
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-06-13 00:00:00.000000000 Z
38
+ date: 2023-06-25 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: erubi
@@ -349,6 +349,8 @@ files:
349
349
  - lib/karafka/web/ui/views/status/failures/_topics.erb
350
350
  - lib/karafka/web/ui/views/status/info/_components.erb
351
351
  - lib/karafka/web/ui/views/status/show.erb
352
+ - lib/karafka/web/ui/views/status/successes/_connection.erb
353
+ - lib/karafka/web/ui/views/status/warnings/_connection.erb
352
354
  - lib/karafka/web/ui/views/status/warnings/_pro_subscription.erb
353
355
  - lib/karafka/web/version.rb
354
356
  - renovate.json
metadata.gz.sig CHANGED
@@ -1,3 +1,3 @@
1
- j*�n�tÈ)�f�(�omk0ip*d�YšO0Ԭ��E,�������W�l|V��Q���誛=\艚Q8Zi��������ۋ���Td���\hz(���aѱz����Ȧ���Y{��~�j�$�� (oy{*�雷AK���[���/�
2
- "HWhC��V!��5�'��k.����#B4���0h}��r��G�� >T��ή�2A����Ó�����~sb���4^���pڷ����Ĝ����#�J۵;��WT�
3
- 5jB1b�F��>�����Lͺƚ桟�!PMyJ5NN74`aTH�� ��P��At.jJV�=�T�]���٢QMt�;���n}�%v�Y��.A��c !�(�
1
+ ��z~Nu��<��7�������xA`���p�\�jcYd3�ݯ�mXJoF|w��Ad2X#�����n��AR��MA�����ع���0$,�AN2����*�J;
2
+ �ҀgkXs�ἦ�Nsrs��'C_�Hj�*��$�:c��f�+�37�����ظ=�Iwy������y�?�
3
+ O��e����Ā��`V0}��<Ϡ�' �Z]naM��F��K6d6K(*��2��Rk��*_��)��t��%\;s<�+�iAe��锼�.%��˔��V'��ȣ�������!s�f�c��n a�C���_9u�&ҿ��c JWS��LX�ŵ�8?��H&����(���ʡ�wTW�X��Qs��