karafka-web 0.6.3 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.github/workflows/ci.yml +13 -4
  4. data/CHANGELOG.md +119 -5
  5. data/Gemfile +1 -0
  6. data/Gemfile.lock +27 -24
  7. data/README.md +2 -0
  8. data/bin/rspecs +6 -0
  9. data/certs/cert_chain.pem +21 -21
  10. data/docker-compose.yml +22 -0
  11. data/karafka-web.gemspec +3 -3
  12. data/lib/karafka/web/app.rb +6 -2
  13. data/lib/karafka/web/cli.rb +51 -47
  14. data/lib/karafka/web/config.rb +33 -9
  15. data/lib/karafka/web/contracts/base.rb +32 -0
  16. data/lib/karafka/web/contracts/config.rb +63 -0
  17. data/lib/karafka/web/deserializer.rb +10 -1
  18. data/lib/karafka/web/errors.rb +29 -7
  19. data/lib/karafka/web/installer.rb +58 -148
  20. data/lib/karafka/web/management/base.rb +34 -0
  21. data/lib/karafka/web/management/clean_boot_file.rb +31 -0
  22. data/lib/karafka/web/management/create_initial_states.rb +101 -0
  23. data/lib/karafka/web/management/create_topics.rb +127 -0
  24. data/lib/karafka/web/management/delete_topics.rb +28 -0
  25. data/lib/karafka/web/management/enable.rb +82 -0
  26. data/lib/karafka/web/management/extend_boot_file.rb +37 -0
  27. data/lib/karafka/web/processing/consumer.rb +73 -17
  28. data/lib/karafka/web/processing/consumers/aggregators/base.rb +56 -0
  29. data/lib/karafka/web/processing/consumers/aggregators/metrics.rb +154 -0
  30. data/lib/karafka/web/processing/consumers/aggregators/state.rb +180 -0
  31. data/lib/karafka/web/processing/consumers/contracts/aggregated_stats.rb +32 -0
  32. data/lib/karafka/web/processing/consumers/contracts/metrics.rb +53 -0
  33. data/lib/karafka/web/processing/consumers/contracts/process.rb +19 -0
  34. data/lib/karafka/web/processing/consumers/contracts/state.rb +49 -0
  35. data/lib/karafka/web/processing/consumers/contracts/topic_stats.rb +21 -0
  36. data/lib/karafka/web/processing/consumers/metrics.rb +29 -0
  37. data/lib/karafka/web/processing/consumers/schema_manager.rb +56 -0
  38. data/lib/karafka/web/processing/consumers/state.rb +6 -9
  39. data/lib/karafka/web/processing/time_series_tracker.rb +130 -0
  40. data/lib/karafka/web/tracking/consumers/contracts/consumer_group.rb +2 -2
  41. data/lib/karafka/web/tracking/consumers/contracts/job.rb +2 -1
  42. data/lib/karafka/web/tracking/consumers/contracts/partition.rb +14 -1
  43. data/lib/karafka/web/tracking/consumers/contracts/report.rb +10 -8
  44. data/lib/karafka/web/tracking/consumers/contracts/subscription_group.rb +2 -2
  45. data/lib/karafka/web/tracking/consumers/contracts/topic.rb +2 -2
  46. data/lib/karafka/web/tracking/consumers/listeners/processing.rb +6 -2
  47. data/lib/karafka/web/tracking/consumers/listeners/statistics.rb +15 -1
  48. data/lib/karafka/web/tracking/consumers/reporter.rb +14 -6
  49. data/lib/karafka/web/tracking/consumers/sampler.rb +80 -39
  50. data/lib/karafka/web/tracking/contracts/error.rb +2 -1
  51. data/lib/karafka/web/ui/app.rb +20 -10
  52. data/lib/karafka/web/ui/base.rb +56 -6
  53. data/lib/karafka/web/ui/controllers/base.rb +28 -0
  54. data/lib/karafka/web/ui/controllers/become_pro.rb +1 -1
  55. data/lib/karafka/web/ui/controllers/cluster.rb +12 -6
  56. data/lib/karafka/web/ui/controllers/consumers.rb +4 -2
  57. data/lib/karafka/web/ui/controllers/dashboard.rb +32 -0
  58. data/lib/karafka/web/ui/controllers/errors.rb +19 -6
  59. data/lib/karafka/web/ui/controllers/jobs.rb +4 -2
  60. data/lib/karafka/web/ui/controllers/requests/params.rb +28 -0
  61. data/lib/karafka/web/ui/controllers/responses/redirect.rb +29 -0
  62. data/lib/karafka/web/ui/helpers/application_helper.rb +57 -14
  63. data/lib/karafka/web/ui/helpers/paths_helper.rb +48 -0
  64. data/lib/karafka/web/ui/lib/hash_proxy.rb +18 -6
  65. data/lib/karafka/web/ui/lib/paginations/base.rb +61 -0
  66. data/lib/karafka/web/ui/lib/paginations/offset_based.rb +96 -0
  67. data/lib/karafka/web/ui/lib/paginations/page_based.rb +70 -0
  68. data/lib/karafka/web/ui/lib/paginations/paginators/arrays.rb +33 -0
  69. data/lib/karafka/web/ui/lib/paginations/paginators/base.rb +23 -0
  70. data/lib/karafka/web/ui/lib/paginations/paginators/partitions.rb +52 -0
  71. data/lib/karafka/web/ui/lib/paginations/paginators/sets.rb +85 -0
  72. data/lib/karafka/web/ui/lib/paginations/watermark_offsets_based.rb +75 -0
  73. data/lib/karafka/web/ui/lib/ttl_cache.rb +82 -0
  74. data/lib/karafka/web/ui/models/cluster_info.rb +59 -0
  75. data/lib/karafka/web/ui/models/consumers_metrics.rb +46 -0
  76. data/lib/karafka/web/ui/models/{state.rb → consumers_state.rb} +6 -2
  77. data/lib/karafka/web/ui/models/health.rb +37 -7
  78. data/lib/karafka/web/ui/models/message.rb +123 -39
  79. data/lib/karafka/web/ui/models/metrics/aggregated.rb +196 -0
  80. data/lib/karafka/web/ui/models/metrics/charts/aggregated.rb +50 -0
  81. data/lib/karafka/web/ui/models/metrics/charts/topics.rb +109 -0
  82. data/lib/karafka/web/ui/models/metrics/topics.rb +101 -0
  83. data/lib/karafka/web/ui/models/partition.rb +27 -0
  84. data/lib/karafka/web/ui/models/process.rb +12 -1
  85. data/lib/karafka/web/ui/models/status.rb +110 -22
  86. data/lib/karafka/web/ui/models/visibility_filter.rb +33 -0
  87. data/lib/karafka/web/ui/pro/app.rb +87 -19
  88. data/lib/karafka/web/ui/pro/controllers/cluster.rb +11 -0
  89. data/lib/karafka/web/ui/pro/controllers/consumers.rb +13 -7
  90. data/lib/karafka/web/ui/pro/controllers/dashboard.rb +54 -0
  91. data/lib/karafka/web/ui/pro/controllers/dlq.rb +1 -2
  92. data/lib/karafka/web/ui/pro/controllers/errors.rb +46 -10
  93. data/lib/karafka/web/ui/pro/controllers/explorer.rb +145 -15
  94. data/lib/karafka/web/ui/pro/controllers/health.rb +10 -2
  95. data/lib/karafka/web/ui/pro/controllers/messages.rb +62 -0
  96. data/lib/karafka/web/ui/pro/controllers/routing.rb +44 -0
  97. data/lib/karafka/web/ui/pro/views/consumers/_breadcrumbs.erb +7 -1
  98. data/lib/karafka/web/ui/pro/views/consumers/_consumer.erb +1 -1
  99. data/lib/karafka/web/ui/pro/views/consumers/_counters.erb +7 -5
  100. data/lib/karafka/web/ui/pro/views/consumers/consumer/_job.erb +3 -3
  101. data/lib/karafka/web/ui/pro/views/consumers/consumer/_metrics.erb +5 -4
  102. data/lib/karafka/web/ui/pro/views/consumers/consumer/_partition.erb +13 -4
  103. data/lib/karafka/web/ui/pro/views/consumers/consumer/_subscription_group.erb +3 -2
  104. data/lib/karafka/web/ui/pro/views/consumers/consumer/_tabs.erb +7 -0
  105. data/lib/karafka/web/ui/pro/views/consumers/details.erb +21 -0
  106. data/lib/karafka/web/ui/pro/views/consumers/index.erb +4 -2
  107. data/lib/karafka/web/ui/pro/views/dashboard/_ranges_selector.erb +39 -0
  108. data/lib/karafka/web/ui/pro/views/dashboard/index.erb +82 -0
  109. data/lib/karafka/web/ui/pro/views/dlq/_topic.erb +1 -1
  110. data/lib/karafka/web/ui/pro/views/errors/_breadcrumbs.erb +8 -6
  111. data/lib/karafka/web/ui/pro/views/errors/_error.erb +2 -2
  112. data/lib/karafka/web/ui/pro/views/errors/_partition_option.erb +1 -1
  113. data/lib/karafka/web/ui/pro/views/errors/_table.erb +21 -0
  114. data/lib/karafka/web/ui/pro/views/errors/_title_with_select.erb +31 -0
  115. data/lib/karafka/web/ui/pro/views/errors/index.erb +9 -56
  116. data/lib/karafka/web/ui/pro/views/errors/partition.erb +17 -0
  117. data/lib/karafka/web/ui/pro/views/errors/show.erb +1 -1
  118. data/lib/karafka/web/ui/pro/views/explorer/_breadcrumbs.erb +6 -4
  119. data/lib/karafka/web/ui/pro/views/explorer/_filtered.erb +16 -0
  120. data/lib/karafka/web/ui/pro/views/explorer/_message.erb +14 -4
  121. data/lib/karafka/web/ui/pro/views/explorer/_no_topics.erb +7 -0
  122. data/lib/karafka/web/ui/pro/views/explorer/_partition_option.erb +3 -3
  123. data/lib/karafka/web/ui/pro/views/explorer/_topic.erb +1 -1
  124. data/lib/karafka/web/ui/pro/views/explorer/index.erb +12 -8
  125. data/lib/karafka/web/ui/pro/views/explorer/messages/_headers.erb +15 -0
  126. data/lib/karafka/web/ui/pro/views/explorer/messages/_key.erb +12 -0
  127. data/lib/karafka/web/ui/pro/views/explorer/partition/_details.erb +35 -0
  128. data/lib/karafka/web/ui/pro/views/explorer/partition/_messages.erb +1 -0
  129. data/lib/karafka/web/ui/pro/views/explorer/partition.erb +6 -4
  130. data/lib/karafka/web/ui/pro/views/explorer/show.erb +48 -5
  131. data/lib/karafka/web/ui/pro/views/explorer/topic/_details.erb +23 -0
  132. data/lib/karafka/web/ui/pro/views/explorer/topic/_empty.erb +3 -0
  133. data/lib/karafka/web/ui/pro/views/explorer/topic/_limited.erb +4 -0
  134. data/lib/karafka/web/ui/pro/views/explorer/topic.erb +51 -0
  135. data/lib/karafka/web/ui/pro/views/health/_breadcrumbs.erb +16 -0
  136. data/lib/karafka/web/ui/pro/views/health/_no_data.erb +9 -0
  137. data/lib/karafka/web/ui/pro/views/health/_partition.erb +17 -15
  138. data/lib/karafka/web/ui/pro/views/health/_partition_offset.erb +40 -0
  139. data/lib/karafka/web/ui/pro/views/health/_tabs.erb +27 -0
  140. data/lib/karafka/web/ui/pro/views/health/offsets.erb +71 -0
  141. data/lib/karafka/web/ui/pro/views/health/overview.erb +68 -0
  142. data/lib/karafka/web/ui/pro/views/jobs/_job.erb +6 -3
  143. data/lib/karafka/web/ui/pro/views/jobs/index.erb +4 -1
  144. data/lib/karafka/web/ui/pro/views/routing/_consumer_group.erb +37 -0
  145. data/lib/karafka/web/ui/pro/views/routing/_detail.erb +25 -0
  146. data/lib/karafka/web/ui/pro/views/routing/_topic.erb +23 -0
  147. data/lib/karafka/web/ui/pro/views/routing/index.erb +10 -0
  148. data/lib/karafka/web/ui/pro/views/routing/show.erb +26 -0
  149. data/lib/karafka/web/ui/pro/views/shared/_navigation.erb +7 -10
  150. data/lib/karafka/web/ui/public/images/logo-gray.svg +28 -0
  151. data/lib/karafka/web/ui/public/javascripts/application.js +30 -0
  152. data/lib/karafka/web/ui/public/javascripts/chart.min.js +14 -0
  153. data/lib/karafka/web/ui/public/javascripts/charts.js +330 -0
  154. data/lib/karafka/web/ui/public/javascripts/datepicker.js +6 -0
  155. data/lib/karafka/web/ui/public/javascripts/live_poll.js +39 -12
  156. data/lib/karafka/web/ui/public/javascripts/offset_datetime.js +74 -0
  157. data/lib/karafka/web/ui/public/javascripts/tabs.js +59 -0
  158. data/lib/karafka/web/ui/public/stylesheets/application.css +11 -0
  159. data/lib/karafka/web/ui/public/stylesheets/datepicker.min.css +12 -0
  160. data/lib/karafka/web/ui/views/cluster/_no_partitions.erb +3 -0
  161. data/lib/karafka/web/ui/views/cluster/_partition.erb +20 -22
  162. data/lib/karafka/web/ui/views/cluster/index.erb +6 -1
  163. data/lib/karafka/web/ui/views/consumers/_consumer.erb +1 -1
  164. data/lib/karafka/web/ui/views/consumers/_counters.erb +6 -4
  165. data/lib/karafka/web/ui/views/consumers/_summary.erb +3 -3
  166. data/lib/karafka/web/ui/views/consumers/index.erb +3 -1
  167. data/lib/karafka/web/ui/views/dashboard/_feature_pro.erb +3 -0
  168. data/lib/karafka/web/ui/views/dashboard/_not_enough_data.erb +15 -0
  169. data/lib/karafka/web/ui/views/dashboard/_ranges_selector.erb +23 -0
  170. data/lib/karafka/web/ui/views/dashboard/index.erb +95 -0
  171. data/lib/karafka/web/ui/views/errors/_detail.erb +12 -0
  172. data/lib/karafka/web/ui/views/errors/_error.erb +2 -2
  173. data/lib/karafka/web/ui/views/errors/show.erb +1 -1
  174. data/lib/karafka/web/ui/views/jobs/index.erb +3 -1
  175. data/lib/karafka/web/ui/views/layout.erb +10 -3
  176. data/lib/karafka/web/ui/views/routing/_consumer_group.erb +8 -6
  177. data/lib/karafka/web/ui/views/routing/_detail.erb +2 -2
  178. data/lib/karafka/web/ui/views/routing/_topic.erb +1 -1
  179. data/lib/karafka/web/ui/views/routing/show.erb +1 -1
  180. data/lib/karafka/web/ui/views/shared/_brand.erb +2 -2
  181. data/lib/karafka/web/ui/views/shared/_chart.erb +14 -0
  182. data/lib/karafka/web/ui/views/shared/_content.erb +2 -2
  183. data/lib/karafka/web/ui/views/shared/_feature_pro.erb +1 -1
  184. data/lib/karafka/web/ui/views/shared/_flashes.erb +9 -0
  185. data/lib/karafka/web/ui/views/shared/_footer.erb +22 -0
  186. data/lib/karafka/web/ui/views/shared/_header.erb +15 -9
  187. data/lib/karafka/web/ui/views/shared/_live_poll.erb +7 -0
  188. data/lib/karafka/web/ui/views/shared/_navigation.erb +5 -8
  189. data/lib/karafka/web/ui/views/shared/_no_paginated_data.erb +9 -0
  190. data/lib/karafka/web/ui/views/shared/_pagination.erb +17 -13
  191. data/lib/karafka/web/ui/views/shared/_tab_nav.erb +7 -0
  192. data/lib/karafka/web/ui/views/shared/exceptions/not_found.erb +34 -32
  193. data/lib/karafka/web/ui/views/shared/exceptions/pro_only.erb +45 -43
  194. data/lib/karafka/web/ui/views/status/failures/_consumers_reports_schema_state.erb +15 -0
  195. data/lib/karafka/web/ui/views/status/failures/_enabled.erb +8 -0
  196. data/lib/karafka/web/ui/views/status/failures/_initial_consumers_metrics.erb +11 -0
  197. data/lib/karafka/web/ui/views/status/failures/{_initial_state.erb → _initial_consumers_state.erb} +3 -3
  198. data/lib/karafka/web/ui/views/status/failures/_partitions.erb +14 -6
  199. data/lib/karafka/web/ui/views/status/info/_components.erb +21 -1
  200. data/lib/karafka/web/ui/views/status/show.erb +62 -5
  201. data/lib/karafka/web/ui/views/status/successes/_enabled.erb +1 -0
  202. data/lib/karafka/web/ui/views/status/warnings/_replication.erb +19 -0
  203. data/lib/karafka/web/version.rb +1 -1
  204. data/lib/karafka/web.rb +11 -0
  205. data.tar.gz.sig +0 -0
  206. metadata +124 -39
  207. metadata.gz.sig +0 -0
  208. data/lib/karafka/web/processing/consumers/aggregator.rb +0 -130
  209. data/lib/karafka/web/tracking/contracts/base.rb +0 -34
  210. data/lib/karafka/web/ui/lib/paginate_array.rb +0 -38
  211. data/lib/karafka/web/ui/pro/views/explorer/_encryption_enabled.erb +0 -18
  212. data/lib/karafka/web/ui/pro/views/explorer/partition/_watermark_offsets.erb +0 -10
  213. data/lib/karafka/web/ui/pro/views/health/index.erb +0 -60
  214. /data/lib/karafka/web/ui/pro/views/explorer/{_detail.erb → messages/_detail.erb} +0 -0
@@ -6,15 +6,21 @@
6
6
 
7
7
  <title>Karafka</title>
8
8
 
9
- <script type="text/javascript" src="<%= root_path('javascripts/timeago.min.js') %>"></script>
10
- <script type="text/javascript" src="<%= root_path('javascripts/bootstrap.min.js') %>"></script>
11
- <script type="text/javascript" src="<%= root_path('javascripts/highlight.min.js') %>"></script>
12
- <script type="text/javascript" src="<%= root_path('javascripts/live_poll.js') %>"></script>
13
- <script type="text/javascript" src="<%= root_path('javascripts/application.js') %>"></script>
9
+ <link href="<%= asset_path('stylesheets/bootstrap.min.css') %>" rel="stylesheet">
10
+ <link href="<%= asset_path('stylesheets/highlight.min.css') %>" rel="stylesheet">
11
+ <link href="<%= asset_path('stylesheets/datepicker.min.css') %>" rel="stylesheet">
12
+ <link href="<%= asset_path('stylesheets/application.css') %>" rel="stylesheet">
14
13
 
15
- <link href="<%= root_path('stylesheets/bootstrap.min.css') %>" rel="stylesheet">
16
- <link href="<%= root_path('stylesheets/highlight.min.css') %>" rel="stylesheet">
17
- <link href="<%= root_path('stylesheets/application.css') %>" rel="stylesheet">
14
+ <script type="module" src="<%= asset_path('javascripts/chart.min.js') %>"></script>
15
+ <script type="text/javascript" src="<%= asset_path('javascripts/timeago.min.js') %>"></script>
16
+ <script type="text/javascript" src="<%= asset_path('javascripts/bootstrap.min.js') %>"></script>
17
+ <script type="text/javascript" src="<%= asset_path('javascripts/highlight.min.js') %>"></script>
18
+ <script type="text/javascript" src="<%= asset_path('javascripts/live_poll.js') %>"></script>
19
+ <script type="text/javascript" src="<%= asset_path('javascripts/tabs.js') %>"></script>
20
+ <script type="text/javascript" src="<%= asset_path('javascripts/charts.js') %>"></script>
21
+ <script type="text/javascript" src="<%= asset_path('javascripts/datepicker.js') %>"></script>
22
+ <script type="text/javascript" src="<%= asset_path('javascripts/offset_datetime.js') %>"></script>
23
+ <script type="text/javascript" src="<%= asset_path('javascripts/application.js') %>"></script>
18
24
 
19
- <link rel="icon" href="<%= root_path('images/favicon.ico') %>">
25
+ <link rel="icon" href="<%= asset_path('images/favicon.ico') %>">
20
26
  </head>
@@ -0,0 +1,7 @@
1
+ <ul class="nav navbar-nav navbar-right">
2
+ <li>
3
+ <span class="btn btn-secondary btn-sm" id="live-poll" data-on="Live polling" data-off="Live poll">
4
+ Live poll
5
+ </a>
6
+ </li>
7
+ </ul>
@@ -4,6 +4,11 @@
4
4
 
5
5
  <div class="collapse navbar-collapse" id="navbarNav">
6
6
  <ul class="navbar-nav">
7
+ <li class="nav-item ms-3">
8
+ <a class="nav-link <%= nav_class(start_with: '/dashboard') %>" href="<%= root_path('dashboard') %>">
9
+ Dashboard
10
+ </a>
11
+ </li>
7
12
  <li class="nav-item ms-3">
8
13
  <a class="nav-link <%= nav_class(start_with: '/consumers') %>" href="<%= root_path('consumers') %>">
9
14
  Consumers
@@ -52,11 +57,3 @@
52
57
  </li>
53
58
  </ul>
54
59
  </div>
55
-
56
- <ul class="nav navbar-nav navbar-right">
57
- <li>
58
- <span class="btn btn-secondary btn-sm" id="live-poll" data-on="Live polling" data-off="Live poll">
59
- Live poll
60
- </a>
61
- </li>
62
- </ul>
@@ -0,0 +1,9 @@
1
+ <div class="alert alert-info" role="alert">
2
+ <p>
3
+ This page does not contain any data.
4
+ </p>
5
+
6
+ <p class="mb-0">
7
+ Try going to the previous or the first page to get meaningful results.
8
+ </p>
9
+ </div>
@@ -1,28 +1,32 @@
1
- <% if @current_page && (@current_page > 1 || @next_page) %>
2
- <div id="pagination" class="container mb-5">
1
+ <% if @pagination && @pagination.paginate? %>
2
+ <div id="pagination" class="container mb-4">
3
3
  <div class="row">
4
4
  <nav>
5
5
  <ul class="pagination justify-content-center">
6
- <li class="page-item <%= 'disabled' if @current_page <= 1 %>">
7
- <a class="page-link" href="<%= current_path(page: 1) %>">
6
+ <li class="page-item <%= 'disabled' unless @pagination.first_offset? %>">
7
+ <a class="page-link" href="<%= current_path(@pagination.offset_key => @pagination.first_offset) %>">
8
8
  <span>&laquo;</span>
9
9
  </a>
10
10
  </li>
11
11
 
12
- <li class="page-item <%= 'disabled' if @current_page <= 1 %>">
13
- <a class="page-link" href="<%= current_path(page: @current_page - 1) %>">
12
+ <li class="page-item <%= 'disabled' unless @pagination.previous_offset? %>">
13
+ <a class="page-link" href="<%= current_path(@pagination.offset_key => @pagination.previous_offset) %>">
14
14
  <span>&lsaquo; Prev</span>
15
15
  </a>
16
16
  </li>
17
17
 
18
- <li class="page-item active disabled">
19
- <a class="page-link" href="<%= current_path(page: @current_page) %>">
20
- <span><%= @current_page %></span>
21
- </a>
22
- </li>
18
+ <% if @pagination.current_offset? %>
19
+ <li class="page-item active disabled">
20
+ <a class="page-link" href="<%= current_path(@pagination.offset_key => @pagination.current_offset) %>">
21
+ <span>
22
+ <%= @pagination.current_label %>
23
+ </span>
24
+ </a>
25
+ </li>
26
+ <% end %>
23
27
 
24
- <li class="page-item <%= 'disabled' unless @next_page %>">
25
- <a class="page-link" href="<%= current_path(page: @next_page) %>">
28
+ <li class="page-item <%= 'disabled' unless @pagination.next_offset? %>">
29
+ <a class="page-link" href="<%= current_path(@pagination.offset_key => @pagination.next_offset) %>">
26
30
  <span>Next &rsaquo;</span>
27
31
  </a>
28
32
  </li>
@@ -0,0 +1,7 @@
1
+ <% active ||= false %>
2
+
3
+ <li class="nav-item" role="presentation">
4
+ <button class="nav-link <%= 'active' if active %>" id="<%= id %>-tab" data-bs-toggle="tab" data-bs-target="#<%= id %>" type="button" role="tab">
5
+ <%= title %>
6
+ </button>
7
+ </li>
@@ -1,41 +1,43 @@
1
- <div id="content">
2
- <div class="d-flex align-items-center justify-content-center vh-100">
3
- <div class="error-message text-center">
4
- <h1 class="display-1 fw-bold">404</h1>
1
+ <main>
2
+ <div id="content">
3
+ <div class="d-flex align-items-center justify-content-center vh-100">
4
+ <div class="error-message text-center">
5
+ <h1 class="display-1 fw-bold">404</h1>
5
6
 
6
- <p class="fs-3 md-5">
7
- <span class="text-danger">
8
- Oops!
9
- </span>
10
- Page not found.
11
- </p>
12
-
13
- <div class="lead">
14
- <p class="mb-5">
15
- The page you're looking for doesn't exist.
7
+ <p class="fs-3 md-5">
8
+ <span class="text-danger">
9
+ Oops!
10
+ </span>
11
+ Page not found.
16
12
  </p>
17
13
 
18
- <p>
19
- Please make sure, that:
20
- </p>
14
+ <div class="lead">
15
+ <p class="mb-5">
16
+ The page you're looking for doesn't exist.
17
+ </p>
21
18
 
22
- <ul class="mb-5 text-start">
23
- <li>You have visited the <a href="<%= root_path('status') %>">Status</a> page to troubleshoot any potential issues</li>
24
- <li>All the topics required by Karafka Web exist</li>
25
- <li>You have used <code>bundle exec karafka-web install</code> to initialize the Web UI</li>
26
- <li>You have a working connection with your Kafka cluster</li>
27
- <li>The resource you requested exists</li>
28
- </ul>
19
+ <p>
20
+ Please make sure, that:
21
+ </p>
29
22
 
30
- <p class="mb-5">
31
- If you were looking for a given process or other real-time information, the state might have changed, and the information you are looking for no longer exists.
32
- </p>
23
+ <ul class="mb-5 text-start">
24
+ <li>You have visited the <a href="<%= root_path('status') %>">Status</a> page to troubleshoot any potential issues</li>
25
+ <li>All the topics required by Karafka Web exist</li>
26
+ <li>You have used <code>bundle exec karafka-web install</code> to initialize the Web UI</li>
27
+ <li>You have a working connection with your Kafka cluster</li>
28
+ <li>The resource you requested exists</li>
29
+ </ul>
33
30
 
34
- <p>
35
- <a href="<%= root_path %>" class="btn btn-primary">Go Home</a>
36
- <a href="<%= root_path('status') %>" class="btn btn-success">Status page</a>
37
- </p>
31
+ <p class="mb-5">
32
+ If you were looking for a given process or other real-time information, the state might have changed, and the information you are looking for no longer exists.
33
+ </p>
34
+
35
+ <p>
36
+ <a href="<%= root_path %>" class="btn btn-primary">Go Home</a>
37
+ <a href="<%= root_path('status') %>" class="btn btn-success">Status page</a>
38
+ </p>
39
+ </div>
38
40
  </div>
39
41
  </div>
40
42
  </div>
41
- </div>
43
+ </main>
@@ -1,48 +1,50 @@
1
- <div id="content">
2
- <div class="d-flex align-items-center justify-content-center vh-100">
3
-
4
- <div class="error-message text-center">
5
- <h1 class="display-1 fw-bold">Pro feature</h1>
6
-
7
- <p class="fs-3 md-5">
8
- <span class="text-danger">
9
- Oops!
10
- </span>
11
- This Web UI feature is available only to
12
- <a href="karafka.io/#become-pro" target="_blank">Pro</a>
13
- users.
14
- </p>
15
-
16
- <div class="lead">
17
- <p class="mb-5">
18
- Open Source software is great, but it is only sometimes sustainable, especially for projects with high-quality expectations.
19
-
20
- Please help us make the Karafka ecosystem better by subscribing to our
21
- <a target="_blank" href="https://karafka.io/#become-pro">Pro</a>
22
- offering.
1
+ <main>
2
+ <div id="content">
3
+ <div class="d-flex align-items-center justify-content-center vh-100">
4
+
5
+ <div class="error-message text-center">
6
+ <h1 class="display-1 fw-bold">Pro feature</h1>
7
+
8
+ <p class="fs-3 md-5">
9
+ <span class="text-danger">
10
+ Oops!
11
+ </span>
12
+ This Web UI feature is available only to
13
+ <a href="karafka.io/#become-pro" target="_blank">Pro</a>
14
+ users.
23
15
  </p>
24
16
 
25
- <p>
26
- Karafka Pro includes:
27
- </p>
28
-
29
- <ul class="mb-5 text-start">
30
- <li>Enhanced Web UI with all the features</li>
31
- <li>Topics data explorer</li>
32
- <li>Enhanced metrics reporting</li>
33
- <li>High throughput data processing-related features</li>
34
- <li>At Rest Encryption</li>
35
- <li>Commercial-friendly license</li>
36
- <li>Priority support</li>
37
- <li>Architecture consultations</li>
38
- </ul>
39
-
40
- <p>
41
- <a href="<%= root_path %>" class="btn btn-primary">Go Home</a>
42
- <a href="https://karafka.io/#become-pro" class="btn btn-success" target="_blank">Become Pro!</a>
43
- </p>
17
+ <div class="lead">
18
+ <p class="mb-5">
19
+ Open Source software is great, but it is only sometimes sustainable, especially for projects with high-quality expectations.
20
+
21
+ Please help us make the Karafka ecosystem better by subscribing to our
22
+ <a target="_blank" href="https://karafka.io/#become-pro">Pro</a>
23
+ offering.
24
+ </p>
25
+
26
+ <p>
27
+ Karafka Pro includes:
28
+ </p>
29
+
30
+ <ul class="mb-5 text-start">
31
+ <li>Enhanced Web UI with all the features</li>
32
+ <li>Topics data explorer</li>
33
+ <li>Enhanced metrics reporting</li>
34
+ <li>High throughput data processing-related features</li>
35
+ <li>At Rest Encryption</li>
36
+ <li>Commercial-friendly license</li>
37
+ <li>Priority support</li>
38
+ <li>Architecture consultations</li>
39
+ </ul>
40
+
41
+ <p>
42
+ <a href="<%= root_path %>" class="btn btn-primary">Go Home</a>
43
+ <a href="https://karafka.io/#become-pro" class="btn btn-success" target="_blank">Become Pro!</a>
44
+ </p>
45
+ </div>
44
46
  </div>
45
- </div>
46
47
 
48
+ </div>
47
49
  </div>
48
- </div>
50
+ </main>
@@ -0,0 +1,15 @@
1
+ <p>
2
+ Incompatible consumer reports detected.
3
+ </p>
4
+
5
+ <p>
6
+ It means that the <code>karafka server</code> process responsible for Web-UI state materialization runs under an older version than the one that sends reports. This process stopped processing incoming reports and the Web-UI data will not be refreshed until the problem is resolved.
7
+ </p>
8
+
9
+ <p>
10
+ To fix this, you must ensure that all the <code>karafka server</code> processes run using the same <code>karafka-web</code> version.
11
+ </p>
12
+
13
+ <p class="mb-0">
14
+ Please note that this should not cause any dashboard metrics losses. Once it is resolved, Karafka Web-UI will catch up.
15
+ </p>
@@ -0,0 +1,8 @@
1
+ <p>
2
+ Karafka Web-UI is not part of your <code>karafka.rb</code>.
3
+ </p>
4
+
5
+ <p class="mb-0">
6
+ Please follow the
7
+ <a href="https://karafka.io/docs/Web-UI-Getting-Started/">setup instructions</a> and make sure that Karafka Web-UI is enabled.
8
+ </p>
@@ -0,0 +1,11 @@
1
+ <p>
2
+ The initial consumers metrics for the Web UI were not created.
3
+ </p>
4
+
5
+ <p>
6
+ It means that the <code>bundle exec karafka-web migrate</code> was not executed or failed.
7
+ </p>
8
+
9
+ <p class="mb-0">
10
+ To fix this, you need to ensure that the <code>bundle exec karafka-web migrate</code> runs successfully.
11
+ </p>
@@ -1,11 +1,11 @@
1
1
  <p>
2
- The initial state for the Web UI was not created.
2
+ The initial consumers state for the Web UI was not created.
3
3
  </p>
4
4
 
5
5
  <p>
6
6
  It means that the <code>bundle exec karafka-web install</code> was not executed or failed.
7
7
  </p>
8
8
 
9
- <p>
10
- To fix this, you need to ensure that the <code>bundle exec karafka-web install</code> runs successfully.
9
+ <p class="mb-0">
10
+ To fix this, you need to ensure that the <code>bundle exec karafka-web migrate</code> runs successfully.
11
11
  </p>
@@ -1,11 +1,19 @@
1
1
  <p>
2
- Both
3
- <code><%= Karafka::Web.config.topics.consumers.states %></code>
4
- and
5
- <code><%= Karafka::Web.config.topics.consumers.reports %></code>
6
- topics need to be configured with <strong>exactly</strong> one partition.
2
+ Following topics need to be configured with <strong>exactly</strong> one partition:
7
3
  </p>
8
4
 
5
+ <ul>
6
+ <li>
7
+ <code><%= Karafka::Web.config.topics.consumers.states %></code>
8
+ </li>
9
+ <li>
10
+ <code><%= Karafka::Web.config.topics.consumers.reports %></code>
11
+ </li>
12
+ <li>
13
+ <code><%= Karafka::Web.config.topics.consumers.metrics %></code>
14
+ </li>
15
+ </ul>
16
+
9
17
  <p>
10
18
  Your current setup contains the following:
11
19
  </p>
@@ -13,7 +21,7 @@
13
21
  <ul class="mb-0">
14
22
  <% details.each do |name, details| %>
15
23
  <li>
16
- <code><%= name %> </code> with <code><%= details[:partitions] %> </code> partitions.
24
+ <code><%= name %> </code> with <code><%= details[:partitions] %></code> partitions.
17
25
  </li>
18
26
  <% end %>
19
27
  </ul>
@@ -2,7 +2,7 @@
2
2
  Below you can find information about your setup. This can be helpful when debugging or reporting bugs and issues.
3
3
  </p>
4
4
 
5
- <p class="mb-0">
5
+ <p>
6
6
  <span class="badge bg-secondary">
7
7
  <%= @sampler.ruby_version %>
8
8
  </span>
@@ -36,4 +36,24 @@
36
36
  waterdrop
37
37
  <%= @sampler.waterdrop_version %>
38
38
  </span>
39
+
40
+ <% if Object.const_defined?(:Rails, false) %>
41
+ <span class="badge bg-secondary">
42
+ rails
43
+ <%= Rails.gem_version %>
44
+ </span>
45
+ <% end %>
39
46
  </p>
47
+
48
+ <hr/>
49
+
50
+ <p>
51
+ Below you can find information about internal Karafka Web-UI topics:
52
+ </p>
53
+
54
+ <ul class="mb-0">
55
+ <li>Errors: <code><%= Karafka::Web.config.topics.errors %></code></li>
56
+ <li>Consumers reports: <code><%= Karafka::Web.config.topics.consumers.reports %></code></li>
57
+ <li>Consumers states: <code><%= Karafka::Web.config.topics.consumers.states %></code></li>
58
+ <li>Consumers metrics: <code><%= Karafka::Web.config.topics.consumers.metrics %></code></li>
59
+ </ul>
@@ -1,8 +1,23 @@
1
1
  <%== view_title('Web UI status details') %>
2
2
 
3
- <div class="container mb-5">
3
+ <div class="container">
4
4
  <div class="row">
5
5
  <div class="col-lg-10 offset-md-1">
6
+ <%==
7
+ partial(
8
+ "status/#{@status.enabled.to_s}",
9
+ locals: {
10
+ title: 'Web-UI setup in karafka.rb',
11
+ description: partial(
12
+ "status/#{@status.enabled.partial_namespace}/enabled",
13
+ locals: {
14
+ details: @status.enabled.details
15
+ }
16
+ )
17
+ }
18
+ )
19
+ %>
20
+
6
21
  <%==
7
22
  partial(
8
23
  "status/#{@status.connection.to_s}",
@@ -50,13 +65,43 @@
50
65
 
51
66
  <%==
52
67
  partial(
53
- "status/#{@status.initial_state.to_s}",
68
+ "status/#{@status.replication.to_s}",
69
+ locals: {
70
+ title: 'Replication factors',
71
+ description: partial(
72
+ 'status/warnings/replication',
73
+ locals: {
74
+ details: @status.replication.details
75
+ }
76
+ )
77
+ }
78
+ )
79
+ %>
80
+
81
+ <%==
82
+ partial(
83
+ "status/#{@status.initial_consumers_state.to_s}",
54
84
  locals: {
55
- title: 'Initial state presence',
85
+ title: 'Initial consumers state presence',
56
86
  description: partial(
57
- 'status/failures/initial_state',
87
+ 'status/failures/initial_consumers_state',
58
88
  locals: {
59
- details: @status.initial_state.details
89
+ details: @status.initial_consumers_state.details
90
+ }
91
+ )
92
+ }
93
+ )
94
+ %>
95
+
96
+ <%==
97
+ partial(
98
+ "status/#{@status.initial_consumers_metrics.to_s}",
99
+ locals: {
100
+ title: 'Initial consumers metrics presence',
101
+ description: partial(
102
+ 'status/failures/initial_consumers_metrics',
103
+ locals: {
104
+ details: @status.initial_consumers_metrics.details
60
105
  }
61
106
  )
62
107
  }
@@ -93,6 +138,18 @@
93
138
  )
94
139
  %>
95
140
 
141
+ <%==
142
+ partial(
143
+ "status/#{@status.consumers_reports_schema_state.to_s}",
144
+ locals: {
145
+ title: 'Consumers reports schema compatibility',
146
+ description: partial(
147
+ 'status/failures/consumers_reports_schema_state'
148
+ )
149
+ }
150
+ )
151
+ %>
152
+
96
153
  <%==
97
154
  partial(
98
155
  "status/#{@status.pro_subscription.to_s}",
@@ -0,0 +1 @@
1
+ <%# Expected to be empty. No content on success needed. %>
@@ -0,0 +1,19 @@
1
+ <p>
2
+ It is recommended to have a replication factor greater than <code>1</code> for all the Karafka Web UI topics in a production environment.
3
+ </p>
4
+
5
+ <p>
6
+ Current replication factors for Karafka Web UI topics:
7
+ </p>
8
+
9
+ <ul>
10
+ <% details.each do |name, details| %>
11
+ <li>
12
+ <code><%= name %></code>: <code><%= details[:replication] %></code>
13
+ </li>
14
+ <% end %>
15
+ </ul>
16
+
17
+ <p>
18
+ Please ensure all those topics have a replication factor of at least <code>2</code>.
19
+ </p>
@@ -3,6 +3,6 @@
3
3
  module Karafka
4
4
  module Web
5
5
  # Current gem version
6
- VERSION = '0.6.3'
6
+ VERSION = '0.7.0'
7
7
  end
8
8
  end
data/lib/karafka/web.rb CHANGED
@@ -5,6 +5,8 @@
5
5
  roda
6
6
  etc
7
7
  open3
8
+ zlib
9
+ securerandom
8
10
  ].each { |lib| require lib }
9
11
 
10
12
  module Karafka
@@ -30,7 +32,16 @@ module Karafka
30
32
  # Activates all the needed routing and sets up listener, etc
31
33
  # This needs to run **after** the optional configuration of the web component
32
34
  def enable!
35
+ # Make sure config is as expected
36
+ # It should be configured before enabling the Web UI
37
+ Contracts::Config.new.validate!(config.to_h)
38
+
33
39
  Installer.new.enable!
40
+
41
+ # Inject correct settings for the Web-UI sessions plugin based on the user configuration
42
+ # We cannot configure this automatically like other Roda plugins because it requires safe
43
+ # custom values provided by our user
44
+ App.engine.plugin(:sessions, **config.ui.sessions.to_h)
34
45
  end
35
46
  end
36
47
  end
data.tar.gz.sig CHANGED
Binary file