karafka-web 0.1.3 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +23 -11
- data/karafka-web.gemspec +2 -2
- data/lib/karafka/web/config.rb +5 -0
- data/lib/karafka/web/installer.rb +1 -2
- data/lib/karafka/web/processing/consumer.rb +2 -1
- data/lib/karafka/web/tracking/consumers/contracts/job.rb +1 -0
- data/lib/karafka/web/tracking/consumers/contracts/report.rb +1 -0
- data/lib/karafka/web/tracking/consumers/listeners/errors.rb +1 -1
- data/lib/karafka/web/tracking/consumers/listeners/processing.rb +2 -1
- data/lib/karafka/web/tracking/consumers/sampler.rb +9 -3
- data/lib/karafka/web/tracking/reporter.rb +2 -1
- data/lib/karafka/web/ui/app.rb +5 -0
- data/lib/karafka/web/ui/controllers/status.rb +23 -0
- data/lib/karafka/web/ui/models/job.rb +4 -0
- data/lib/karafka/web/ui/models/process.rb +7 -0
- data/lib/karafka/web/ui/models/status.rb +169 -0
- data/lib/karafka/web/ui/pro/app.rb +5 -0
- data/lib/karafka/web/ui/pro/controllers/status.rb +26 -0
- data/lib/karafka/web/ui/pro/views/consumers/_consumer.erb +15 -7
- data/lib/karafka/web/ui/pro/views/consumers/consumer/_job.erb +4 -0
- data/lib/karafka/web/ui/pro/views/consumers/consumer/_metrics.erb +10 -0
- data/lib/karafka/web/ui/pro/views/jobs/_job.erb +4 -0
- data/lib/karafka/web/ui/pro/views/shared/_navigation.erb +5 -0
- data/lib/karafka/web/ui/views/consumers/_consumer.erb +15 -7
- data/lib/karafka/web/ui/views/jobs/_job.erb +4 -0
- data/lib/karafka/web/ui/views/shared/_navigation.erb +5 -0
- data/lib/karafka/web/ui/views/shared/exceptions/not_found.erb +2 -0
- data/lib/karafka/web/ui/views/status/_breadcrumbs.erb +5 -0
- data/lib/karafka/web/ui/views/status/_failure.erb +14 -0
- data/lib/karafka/web/ui/views/status/_halted.erb +11 -0
- data/lib/karafka/web/ui/views/status/_success.erb +11 -0
- data/lib/karafka/web/ui/views/status/failures/_connection.erb +7 -0
- data/lib/karafka/web/ui/views/status/failures/_initial_state.erb +20 -0
- data/lib/karafka/web/ui/views/status/failures/_live_reporting.erb +7 -0
- data/lib/karafka/web/ui/views/status/failures/_partitions.erb +19 -0
- data/lib/karafka/web/ui/views/status/failures/_state_calculation.erb +8 -0
- data/lib/karafka/web/ui/views/status/failures/_topics.erb +20 -0
- data/lib/karafka/web/ui/views/status/show.erb +94 -0
- data/lib/karafka/web/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +20 -14
- metadata.gz.sig +0 -0
- data/lib/karafka/web/ui/views/consumers/consumer/_consumer_group.erb +0 -109
- data/lib/karafka/web/ui/views/consumers/consumer/_job.erb +0 -26
- data/lib/karafka/web/ui/views/consumers/consumer/_metrics.erb +0 -126
- data/lib/karafka/web/ui/views/consumers/consumer/_no_jobs.erb +0 -9
- data/lib/karafka/web/ui/views/consumers/consumer/_no_subscriptions.erb +0 -9
- data/lib/karafka/web/ui/views/consumers/consumer/_partition.erb +0 -32
- data/lib/karafka/web/ui/views/consumers/consumer/_stopped.erb +0 -10
- data/lib/karafka/web/ui/views/consumers/consumer/_tabs.erb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 020c1e94ca0603044d2260ebe796a6509432b7ec100aadc7505a6de85e5cf341
|
4
|
+
data.tar.gz: 71f6a22eb9bccbaa9bb9f4005d79667b83d486e13f59d966f3ccdaf049aff0e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c480170adb20bcf51abe1be667343c198a09dbeb5280443cbdcbfe60f917a44ba0cdb8b8d3dd558c4a102299c9e131f902958f312f11f392329b3bae440e57b7
|
7
|
+
data.tar.gz: 16ca1295589f06cf7ebd7804353a6ccaf08d77d7cce1ef7046a763dd5b8f2f0abf248c4e73431032dfae19ca9250eedfa1729e2983b063eaa85dbd16d3ce0eb8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Karafka Web changelog
|
2
2
|
|
3
|
+
## 0.2.1 (2023-02-24)
|
4
|
+
- [Fix] Fix format incompatibility between 0.1.x and 0.2.x data formats. This will allow for the 0.2 Web UI to work with 0.1.x reporting.
|
5
|
+
|
6
|
+
## 0.2.0 (2023-02-24)
|
7
|
+
- **[Feature]** Introduce ability to tag `Karafka::Process` to display process-centric tags in the Web UI.
|
8
|
+
- **[Feature]** Introduce ability to tag consumer instances to display consumption-centric tags in the Web UI.
|
9
|
+
- **[Feature]** Introduce a /status page that can validate the setup and tell what is missing (#1318)
|
10
|
+
- [Improvement] Allow for disabling the consumer subscription from Web for multi-tenant Web UI usage (#1331)
|
11
|
+
- [Improvement] Make sure that states and reports are always dispatched to the partition `0`. This should prevent UI from not fully working when someone accidentally creates more partitions than expected.
|
12
|
+
- [Fix] Fix a bug where bootstrapping would create two initial states.
|
13
|
+
- [Fix] Fix a case, where errors listener would try to force encoding on a frozen error message.
|
14
|
+
|
3
15
|
## 0.1.3 (2023-02-14)
|
4
16
|
- Skip topics creation if web topics already exist (do not raise error)
|
5
17
|
- Support ability to provide replication factor in the install command
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,41 +1,51 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
karafka-web (0.1
|
4
|
+
karafka-web (0.2.1)
|
5
5
|
erubi (~> 1.4)
|
6
|
-
karafka (>= 2.0.
|
7
|
-
karafka-core (>= 2.0.
|
6
|
+
karafka (>= 2.0.33, < 3.0.0)
|
7
|
+
karafka-core (>= 2.0.12, < 3.0.0)
|
8
8
|
roda (~> 3.63)
|
9
9
|
tilt (~> 2.0)
|
10
10
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
+
activesupport (7.0.4.2)
|
15
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
16
|
+
i18n (>= 1.6, < 2)
|
17
|
+
minitest (>= 5.1)
|
18
|
+
tzinfo (~> 2.0)
|
14
19
|
byebug (11.1.3)
|
15
20
|
concurrent-ruby (1.2.0)
|
16
21
|
diff-lcs (1.5.0)
|
17
22
|
docile (1.4.0)
|
18
23
|
erubi (1.12.0)
|
24
|
+
factory_bot (6.2.1)
|
25
|
+
activesupport (>= 5.0.0)
|
19
26
|
ffi (1.15.5)
|
20
|
-
|
21
|
-
|
27
|
+
i18n (1.12.0)
|
28
|
+
concurrent-ruby (~> 1.0)
|
29
|
+
karafka (2.0.33)
|
30
|
+
karafka-core (>= 2.0.12, < 3.0.0)
|
22
31
|
thor (>= 0.20)
|
23
32
|
waterdrop (>= 2.4.10, < 3.0.0)
|
24
33
|
zeitwerk (~> 2.3)
|
25
|
-
karafka-core (2.0.
|
34
|
+
karafka-core (2.0.12)
|
26
35
|
concurrent-ruby (>= 1.1)
|
27
|
-
karafka-rdkafka (>= 0.12)
|
28
|
-
karafka-rdkafka (0.12.
|
36
|
+
karafka-rdkafka (>= 0.12.1)
|
37
|
+
karafka-rdkafka (0.12.1)
|
29
38
|
ffi (~> 1.15)
|
30
39
|
mini_portile2 (~> 2.6)
|
31
40
|
rake (> 12)
|
32
41
|
mini_portile2 (2.8.1)
|
42
|
+
minitest (5.17.0)
|
33
43
|
rack (3.0.4.1)
|
34
44
|
rackup (0.2.3)
|
35
45
|
rack (>= 3.0.0.beta1)
|
36
46
|
webrick
|
37
47
|
rake (13.0.6)
|
38
|
-
roda (3.
|
48
|
+
roda (3.65.0)
|
39
49
|
rack
|
40
50
|
rspec (3.12.0)
|
41
51
|
rspec-core (~> 3.12.0)
|
@@ -57,7 +67,9 @@ GEM
|
|
57
67
|
simplecov-html (0.12.3)
|
58
68
|
simplecov_json_formatter (0.1.4)
|
59
69
|
thor (1.2.1)
|
60
|
-
tilt (2.0
|
70
|
+
tilt (2.1.0)
|
71
|
+
tzinfo (2.0.6)
|
72
|
+
concurrent-ruby (~> 1.0)
|
61
73
|
waterdrop (2.4.10)
|
62
74
|
karafka-core (>= 2.0.9, < 3.0.0)
|
63
75
|
zeitwerk (~> 2.3)
|
@@ -65,11 +77,11 @@ GEM
|
|
65
77
|
zeitwerk (2.6.7)
|
66
78
|
|
67
79
|
PLATFORMS
|
68
|
-
arm64-darwin-21
|
69
80
|
x86_64-linux
|
70
81
|
|
71
82
|
DEPENDENCIES
|
72
83
|
byebug
|
84
|
+
factory_bot
|
73
85
|
karafka-web!
|
74
86
|
rackup (~> 0.2)
|
75
87
|
rspec
|
data/karafka-web.gemspec
CHANGED
@@ -17,8 +17,8 @@ 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.
|
21
|
-
spec.add_dependency 'karafka-core', '>= 2.0.
|
20
|
+
spec.add_dependency 'karafka', '>= 2.0.33', '< 3.0.0'
|
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'
|
24
24
|
|
data/lib/karafka/web/config.rb
CHANGED
@@ -56,6 +56,11 @@ module Karafka
|
|
56
56
|
|
57
57
|
# States processing related settings
|
58
58
|
setting :processing do
|
59
|
+
# Should we actively process reports
|
60
|
+
# This can be disabled in case of using a multi-tenant approach where only one of the
|
61
|
+
# apps should materialize the state
|
62
|
+
setting :active, default: true
|
63
|
+
|
59
64
|
# What should be the consumer group name for web consumer
|
60
65
|
setting :consumer_group, default: 'karafka_web'
|
61
66
|
|
@@ -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
|
+
active ::Karafka::Web.config.processing.active
|
48
49
|
# Since we materialize state in intervals, we can poll for half of this time without
|
49
50
|
# impacting the reporting responsiveness
|
50
51
|
max_wait_time ::Karafka::Web.config.processing.interval / 2
|
@@ -128,8 +129,6 @@ module Karafka
|
|
128
129
|
replication_factor
|
129
130
|
)
|
130
131
|
end
|
131
|
-
|
132
|
-
bootstrap_state!
|
133
132
|
end
|
134
133
|
|
135
134
|
# Creates the initial state record with all values being empty
|
@@ -57,7 +57,8 @@ module Karafka
|
|
57
57
|
topic: Karafka::Web.config.topics.consumers.states,
|
58
58
|
payload: @consumers_aggregator.to_json,
|
59
59
|
# This will ensure that the consumer states are compacted
|
60
|
-
key: Karafka::Web.config.topics.consumers.states
|
60
|
+
key: Karafka::Web.config.topics.consumers.states,
|
61
|
+
partition: 0
|
61
62
|
)
|
62
63
|
end
|
63
64
|
end
|
@@ -18,6 +18,7 @@ module Karafka
|
|
18
18
|
required(:last_offset) { |val| val.is_a?(Integer) && val >= 0 }
|
19
19
|
required(:comitted_offset) { |val| val.is_a?(Integer) }
|
20
20
|
required(:type) { |val| %w[consume revoked shutdown].include?(val) }
|
21
|
+
required(:tags) { |val| val.is_a?(Karafka::Core::Taggable::Tags) }
|
21
22
|
end
|
22
23
|
end
|
23
24
|
end
|
@@ -27,6 +27,7 @@ module Karafka
|
|
27
27
|
required(:status) { |val| ::Karafka::Status::STATES.key?(val.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
|
+
required(:tags) { |val| val.is_a?(Karafka::Core::Taggable::Tags) }
|
30
31
|
|
31
32
|
required(:cpu_usage) do |val|
|
32
33
|
val.is_a?(Array) &&
|
@@ -74,7 +74,7 @@ module Karafka
|
|
74
74
|
# @param error [StandardError] error that occurred
|
75
75
|
# @return [Array<String, String, String>] array with error name, message and backtrace
|
76
76
|
def extract_error_info(error)
|
77
|
-
error_message = error.message.to_s
|
77
|
+
error_message = error.message.to_s.dup
|
78
78
|
error_message.force_encoding('utf-8')
|
79
79
|
error_message.scrub!
|
80
80
|
|
@@ -11,13 +11,18 @@ module Karafka
|
|
11
11
|
|
12
12
|
attr_reader :counters, :consumer_groups, :errors, :times, :pauses, :jobs
|
13
13
|
|
14
|
+
# Current schema version
|
15
|
+
# This can be used in the future for detecting incompatible changes and writing
|
16
|
+
# migrations
|
17
|
+
SCHEMA_VERSION = '1.0.1'
|
18
|
+
|
14
19
|
# 60 seconds window for time tracked window-based metrics
|
15
20
|
TIMES_TTL = 60
|
16
21
|
|
17
22
|
# Times ttl in ms
|
18
23
|
TIMES_TTL_MS = TIMES_TTL * 1_000
|
19
24
|
|
20
|
-
private_constant :TIMES_TTL, :TIMES_TTL_MS
|
25
|
+
private_constant :TIMES_TTL, :TIMES_TTL_MS, :SCHEMA_VERSION
|
21
26
|
|
22
27
|
def initialize
|
23
28
|
@counters = {
|
@@ -47,7 +52,7 @@ module Karafka
|
|
47
52
|
# @return [Hash] report hash with all the details about consumer operations
|
48
53
|
def to_report
|
49
54
|
{
|
50
|
-
schema_version:
|
55
|
+
schema_version: SCHEMA_VERSION,
|
51
56
|
type: 'consumer',
|
52
57
|
dispatched_at: float_now,
|
53
58
|
|
@@ -61,7 +66,8 @@ module Karafka
|
|
61
66
|
memory_total_usage: memory_total_usage,
|
62
67
|
memory_size: memory_size,
|
63
68
|
cpu_count: cpu_count,
|
64
|
-
cpu_usage: cpu_usage
|
69
|
+
cpu_usage: cpu_usage,
|
70
|
+
tags: Karafka::Process.tags
|
65
71
|
},
|
66
72
|
|
67
73
|
versions: {
|
data/lib/karafka/web/ui/app.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Karafka
|
4
|
+
module Web
|
5
|
+
module Ui
|
6
|
+
module Controllers
|
7
|
+
# View that helps understand the status of the Web UI
|
8
|
+
# Many people reported problems understanding the requirements or misconfigured things.
|
9
|
+
# While all of the things are documented, people are lazy. Hence we provide a status
|
10
|
+
# page where we check that everything is as expected and if not, we can provide some
|
11
|
+
# helpful instructions on how to fix the issues.
|
12
|
+
class Status < Base
|
13
|
+
# Displays the Web UI setup status
|
14
|
+
def show
|
15
|
+
@status = Models::Status.new
|
16
|
+
|
17
|
+
respond
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -40,6 +40,13 @@ module Karafka
|
|
40
40
|
.sort_by(&:started_at)
|
41
41
|
end
|
42
42
|
|
43
|
+
# @return [Array<String>] tags of this consuming process
|
44
|
+
# @note We use direct reference here and a fallback for users that come from the versions
|
45
|
+
# that did not report tags
|
46
|
+
def tags
|
47
|
+
@hash[:process][:tags] || []
|
48
|
+
end
|
49
|
+
|
43
50
|
# @return [Integer] collective lag on this process
|
44
51
|
def lag_stored
|
45
52
|
consumer_groups
|
@@ -0,0 +1,169 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Karafka
|
4
|
+
module Web
|
5
|
+
module Ui
|
6
|
+
module Models
|
7
|
+
# Model that represents the general status of the Web UI.
|
8
|
+
# We use this data to display a status page that helps with debugging on what is missing
|
9
|
+
# in the overall setup of the Web UI.
|
10
|
+
#
|
11
|
+
# People have various problems like too many partitions, not created topics, etc. and this
|
12
|
+
# data and view aims to help them with understanding the current status of the setup
|
13
|
+
class Status
|
14
|
+
# Status of a single step of setup
|
15
|
+
Step = Struct.new(:status, :details) do
|
16
|
+
# @return [Boolean] is the given step successfully configured and working
|
17
|
+
def success?
|
18
|
+
status == :success
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [String] stringified status
|
22
|
+
def to_s
|
23
|
+
status.to_s
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# Initializes the status object and tries to connect to Kafka
|
28
|
+
def initialize
|
29
|
+
connect
|
30
|
+
end
|
31
|
+
|
32
|
+
# @return [Status::Step] were we able to connect to Kafka or not
|
33
|
+
def connection
|
34
|
+
Step.new(
|
35
|
+
@connected ? :success : :failure,
|
36
|
+
nil
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
# @return [Status::Step] do all the needed topics exist
|
41
|
+
def topics
|
42
|
+
if connection.success?
|
43
|
+
details = topics_details
|
44
|
+
status = details.all? { |_, detail| detail[:present] } ? :success : :failure
|
45
|
+
else
|
46
|
+
status = :halted
|
47
|
+
details = {}
|
48
|
+
end
|
49
|
+
|
50
|
+
Step.new(
|
51
|
+
status,
|
52
|
+
details
|
53
|
+
)
|
54
|
+
end
|
55
|
+
|
56
|
+
# @return [Status::Step] do we have all topics with expected number of partitions
|
57
|
+
def partitions
|
58
|
+
if topics.success?
|
59
|
+
status = :success
|
60
|
+
status = :failure if topics_details[topics_consumers_states][:partitions] != 1
|
61
|
+
status = :failure if topics_details[topics_consumers_reports][:partitions] != 1
|
62
|
+
details = topics_details
|
63
|
+
else
|
64
|
+
status = :halted
|
65
|
+
details = {}
|
66
|
+
end
|
67
|
+
|
68
|
+
Step.new(
|
69
|
+
status,
|
70
|
+
details
|
71
|
+
)
|
72
|
+
end
|
73
|
+
|
74
|
+
# @return [Status::Step] Is the initial state present in the setup or not
|
75
|
+
def initial_state
|
76
|
+
if partitions.success?
|
77
|
+
@current_state ||= Models::State.current
|
78
|
+
status = @current_state ? :success : :failure
|
79
|
+
else
|
80
|
+
status = :halted
|
81
|
+
end
|
82
|
+
|
83
|
+
Step.new(
|
84
|
+
status,
|
85
|
+
nil
|
86
|
+
)
|
87
|
+
end
|
88
|
+
|
89
|
+
# @return [Status::Step] Is there at least one active karafka server reporting to the
|
90
|
+
# Web UI
|
91
|
+
def live_reporting
|
92
|
+
if initial_state.success?
|
93
|
+
@processes ||= Models::Processes.active(@current_state)
|
94
|
+
status = @processes.empty? ? :failure : :success
|
95
|
+
else
|
96
|
+
status = :halted
|
97
|
+
end
|
98
|
+
|
99
|
+
Step.new(
|
100
|
+
status,
|
101
|
+
nil
|
102
|
+
)
|
103
|
+
end
|
104
|
+
|
105
|
+
# @return [Status::Step] is there a subscription to our reports topic that is being
|
106
|
+
# consumed actively.
|
107
|
+
def state_calculation
|
108
|
+
if live_reporting.success?
|
109
|
+
@subscriptions ||= Models::Health.current(@current_state).values.flat_map(&:keys)
|
110
|
+
status = @subscriptions.include?(topics_consumers_reports) ? :success : :failure
|
111
|
+
else
|
112
|
+
status = :halted
|
113
|
+
end
|
114
|
+
|
115
|
+
Step.new(
|
116
|
+
status,
|
117
|
+
nil
|
118
|
+
)
|
119
|
+
end
|
120
|
+
|
121
|
+
private
|
122
|
+
|
123
|
+
# @return [String] consumers states topic name
|
124
|
+
def topics_consumers_states
|
125
|
+
::Karafka::Web.config.topics.consumers.states.to_s
|
126
|
+
end
|
127
|
+
|
128
|
+
# @return [String] consumers reports topic name
|
129
|
+
def topics_consumers_reports
|
130
|
+
::Karafka::Web.config.topics.consumers.reports.to_s
|
131
|
+
end
|
132
|
+
|
133
|
+
# @return [String] errors topic name
|
134
|
+
def topics_errors
|
135
|
+
::Karafka::Web.config.topics.errors
|
136
|
+
end
|
137
|
+
|
138
|
+
# @return [Hash] hash with topics with which we work details (even if don't exist)
|
139
|
+
def topics_details
|
140
|
+
topics = {
|
141
|
+
topics_consumers_states => { present: false, partitions: 0 },
|
142
|
+
topics_consumers_reports => { present: false, partitions: 0 },
|
143
|
+
topics_errors => { present: false, partitions: 0 }
|
144
|
+
}
|
145
|
+
|
146
|
+
@cluster_info.topics.each do |topic|
|
147
|
+
name = topic[:topic_name]
|
148
|
+
|
149
|
+
next unless topics.key?(name)
|
150
|
+
|
151
|
+
topics[name][:present] = true
|
152
|
+
topics[name][:partitions] = topic[:partition_count]
|
153
|
+
end
|
154
|
+
|
155
|
+
topics
|
156
|
+
end
|
157
|
+
|
158
|
+
# Tries connecting with the cluster and sets the connection state
|
159
|
+
def connect
|
160
|
+
@cluster_info = ::Karafka::Admin.cluster_info
|
161
|
+
@connected = true
|
162
|
+
rescue ::Rdkafka::RdkafkaError
|
163
|
+
@connected = false
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
169
|
+
end
|
@@ -112,6 +112,11 @@ module Karafka
|
|
112
112
|
controller = Controllers::Dlq.new(params)
|
113
113
|
render_response controller.index
|
114
114
|
end
|
115
|
+
|
116
|
+
r.get 'status' do
|
117
|
+
controller = Controllers::Status.new(params)
|
118
|
+
render_response controller.show
|
119
|
+
end
|
115
120
|
end
|
116
121
|
end
|
117
122
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This Karafka component is a Pro component under a commercial license.
|
4
|
+
# This Karafka component is NOT licensed under LGPL.
|
5
|
+
#
|
6
|
+
# All of the commercial components are present in the lib/karafka/pro directory of this
|
7
|
+
# repository and their usage requires commercial license agreement.
|
8
|
+
#
|
9
|
+
# Karafka has also commercial-friendly license, commercial support and commercial components.
|
10
|
+
#
|
11
|
+
# By sending a pull request to the pro components, you are agreeing to transfer the copyright of
|
12
|
+
# your code to Maciej Mensfeld.
|
13
|
+
|
14
|
+
module Karafka
|
15
|
+
module Web
|
16
|
+
module Ui
|
17
|
+
module Pro
|
18
|
+
module Controllers
|
19
|
+
# Status details - same as in OSS
|
20
|
+
class Status < Ui::Controllers::Status
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -8,16 +8,24 @@
|
|
8
8
|
<%= process.name %>
|
9
9
|
</a>
|
10
10
|
|
11
|
-
<
|
11
|
+
<p class="mt-0 mb-1">
|
12
|
+
<% process.consumer_groups.each do |consumer_group| %>
|
13
|
+
<% consumer_group.topics.each do |topic| %>
|
14
|
+
<span class="badge bg-secondary badge-topic" title="Consumer group: <%= consumer_group.id %>">
|
15
|
+
<%= topic.name %>:
|
16
|
+
<%= topic.partitions.map(&:id).join(',') %>
|
17
|
+
</span>
|
18
|
+
<% end %>
|
19
|
+
<% end %>
|
20
|
+
</p>
|
12
21
|
|
13
|
-
|
14
|
-
<%
|
15
|
-
<span class="badge bg-
|
16
|
-
<%=
|
17
|
-
<%= topic.partitions.map(&:id).join(',') %>
|
22
|
+
<p class="mt-0 mb-1">
|
23
|
+
<% process.tags.each do |tag| %>
|
24
|
+
<span class="badge bg-info badge-topic">
|
25
|
+
<%= tag %>
|
18
26
|
</span>
|
19
27
|
<% end %>
|
20
|
-
|
28
|
+
</p>
|
21
29
|
</td>
|
22
30
|
|
23
31
|
<td>
|
@@ -27,6 +27,16 @@
|
|
27
27
|
</li>
|
28
28
|
</ul>
|
29
29
|
</p>
|
30
|
+
|
31
|
+
<% unless @process.tags.empty? %>
|
32
|
+
<p class="mb-0 text-end">
|
33
|
+
<% @process.tags.each do |tag| %>
|
34
|
+
<span class="badge bg-info badge-topic">
|
35
|
+
<%= tag %>
|
36
|
+
</span>
|
37
|
+
<% end %>
|
38
|
+
</p>
|
39
|
+
<% end %>
|
30
40
|
</div>
|
31
41
|
</div>
|
32
42
|
<div class="card">
|
@@ -8,16 +8,24 @@
|
|
8
8
|
<%= process.name %>
|
9
9
|
</a>
|
10
10
|
|
11
|
-
<
|
11
|
+
<p class="mt-0 mb-1">
|
12
|
+
<% process.consumer_groups.each do |consumer_group| %>
|
13
|
+
<% consumer_group.topics.each do |topic| %>
|
14
|
+
<span class="badge bg-secondary badge-topic" title="Consumer group: <%= consumer_group.id %>">
|
15
|
+
<%= topic.name %>:
|
16
|
+
<%= topic.partitions.map(&:id).join(',') %>
|
17
|
+
</span>
|
18
|
+
<% end %>
|
19
|
+
<% end %>
|
20
|
+
</p>
|
12
21
|
|
13
|
-
|
14
|
-
<%
|
15
|
-
<span class="badge bg-
|
16
|
-
<%=
|
17
|
-
<%= topic.partitions.map(&:id).join(',') %>
|
22
|
+
<p class="mt-0 mb-1">
|
23
|
+
<% process.tags.each do |tag| %>
|
24
|
+
<span class="badge bg-info badge-topic">
|
25
|
+
<%= tag %>
|
18
26
|
</span>
|
19
27
|
<% end %>
|
20
|
-
|
28
|
+
</p>
|
21
29
|
</td>
|
22
30
|
|
23
31
|
<td>
|