karafka-web 0.8.1 → 0.9.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (274) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.github/workflows/ci.yml +5 -16
  4. data/CHANGELOG.md +47 -0
  5. data/Gemfile.lock +33 -35
  6. data/LICENSE +3 -3
  7. data/bin/rspecs +1 -1
  8. data/config/locales/pro_errors.yml +11 -0
  9. data/config/locales/slogans.yml +62 -0
  10. data/docker-compose.yml +1 -1
  11. data/karafka-web.gemspec +4 -2
  12. data/lib/karafka/web/app.rb +1 -1
  13. data/lib/karafka/web/config.rb +19 -0
  14. data/lib/karafka/web/contracts/config.rb +6 -0
  15. data/lib/karafka/web/installer.rb +4 -1
  16. data/lib/karafka/web/management/actions/create_topics.rb +21 -0
  17. data/lib/karafka/web/management/actions/delete_topics.rb +1 -0
  18. data/lib/karafka/web/management/actions/enable.rb +11 -5
  19. data/lib/karafka/web/management/migrations/0_base.rb +1 -1
  20. data/lib/karafka/web/pro/commanding/commands/base.rb +33 -0
  21. data/lib/karafka/web/pro/commanding/commands/probe.rb +41 -0
  22. data/lib/karafka/web/pro/commanding/commands/quiet.rb +31 -0
  23. data/lib/karafka/web/pro/commanding/commands/stop.rb +31 -0
  24. data/lib/karafka/web/pro/commanding/config.rb +57 -0
  25. data/lib/karafka/web/pro/commanding/contracts/config.rb +60 -0
  26. data/lib/karafka/web/pro/commanding/dispatcher.rb +93 -0
  27. data/lib/karafka/web/pro/commanding/listener.rb +97 -0
  28. data/lib/karafka/web/pro/commanding/manager.rb +98 -0
  29. data/lib/karafka/web/pro/commanding/matcher.rb +50 -0
  30. data/lib/karafka/web/pro/commanding.rb +40 -0
  31. data/lib/karafka/web/pro/loader.rb +40 -0
  32. data/lib/karafka/web/{ui/pro → pro/ui}/app.rb +103 -22
  33. data/lib/karafka/web/{ui/pro/controllers/cluster.rb → pro/ui/controllers/base_controller.rb} +4 -5
  34. data/lib/karafka/web/pro/ui/controllers/cluster_controller.rb +54 -0
  35. data/lib/karafka/web/pro/ui/controllers/commanding_controller.rb +118 -0
  36. data/lib/karafka/web/pro/ui/controllers/commands_controller.rb +96 -0
  37. data/lib/karafka/web/{ui/pro/controllers/consumers.rb → pro/ui/controllers/consumers_controller.rb} +31 -4
  38. data/lib/karafka/web/{ui/pro/controllers/dashboard.rb → pro/ui/controllers/dashboard_controller.rb} +5 -3
  39. data/lib/karafka/web/pro/ui/controllers/dlq_controller.rb +60 -0
  40. data/lib/karafka/web/{ui/pro/controllers/errors.rb → pro/ui/controllers/errors_controller.rb} +5 -7
  41. data/lib/karafka/web/{ui/pro/controllers/explorer.rb → pro/ui/controllers/explorer_controller.rb} +24 -19
  42. data/lib/karafka/web/{ui/pro/controllers/health.rb → pro/ui/controllers/health_controller.rb} +16 -3
  43. data/lib/karafka/web/{ui/pro/controllers/jobs.rb → pro/ui/controllers/jobs_controller.rb} +4 -4
  44. data/lib/karafka/web/{ui/pro/controllers/messages.rb → pro/ui/controllers/messages_controller.rb} +8 -6
  45. data/lib/karafka/web/{ui/pro/controllers/routing.rb → pro/ui/controllers/routing_controller.rb} +6 -22
  46. data/lib/karafka/web/{ui/pro/controllers/status.rb → pro/ui/controllers/status_controller.rb} +3 -3
  47. data/lib/karafka/web/pro/ui/controllers/topics_controller.rb +99 -0
  48. data/lib/karafka/web/pro/ui/lib/patterns_detector.rb +50 -0
  49. data/lib/karafka/web/pro/ui/views/cluster/_breadcrumbs.erb +29 -0
  50. data/lib/karafka/web/pro/ui/views/cluster/_broker.erb +13 -0
  51. data/lib/karafka/web/pro/ui/views/cluster/_config.erb +13 -0
  52. data/lib/karafka/web/pro/ui/views/cluster/_tabs.erb +27 -0
  53. data/lib/karafka/web/pro/ui/views/cluster/brokers.erb +27 -0
  54. data/lib/karafka/web/pro/ui/views/cluster/index.erb +27 -0
  55. data/lib/karafka/web/pro/ui/views/cluster/show.erb +27 -0
  56. data/lib/karafka/web/pro/ui/views/commands/_backtrace.erb +20 -0
  57. data/lib/karafka/web/pro/ui/views/commands/_breadcrumbs.erb +21 -0
  58. data/lib/karafka/web/pro/ui/views/commands/_command.erb +60 -0
  59. data/lib/karafka/web/pro/ui/views/commands/_command_details.erb +11 -0
  60. data/lib/karafka/web/pro/ui/views/commands/_details.erb +26 -0
  61. data/lib/karafka/web/pro/ui/views/commands/_empty.erb +3 -0
  62. data/lib/karafka/web/pro/ui/views/commands/_incompatible_schema.erb +14 -0
  63. data/lib/karafka/web/pro/ui/views/commands/_metadata.erb +50 -0
  64. data/lib/karafka/web/pro/ui/views/commands/_table.erb +23 -0
  65. data/lib/karafka/web/pro/ui/views/commands/index.erb +17 -0
  66. data/lib/karafka/web/pro/ui/views/commands/show.erb +38 -0
  67. data/lib/karafka/web/{ui/pro → pro/ui}/views/consumers/_breadcrumbs.erb +20 -4
  68. data/lib/karafka/web/{ui/pro → pro/ui}/views/consumers/_consumer.erb +2 -21
  69. data/lib/karafka/web/pro/ui/views/consumers/_consumer_controls.erb +78 -0
  70. data/lib/karafka/web/pro/ui/views/consumers/_consumer_performance.erb +59 -0
  71. data/lib/karafka/web/{ui/pro → pro/ui}/views/consumers/_counters.erb +7 -5
  72. data/lib/karafka/web/pro/ui/views/consumers/_tabs.erb +35 -0
  73. data/lib/karafka/web/pro/ui/views/consumers/consumer/_commands.erb +32 -0
  74. data/lib/karafka/web/pro/ui/views/consumers/consumer/_no_jobs.erb +7 -0
  75. data/lib/karafka/web/pro/ui/views/consumers/consumer/_no_subscriptions.erb +7 -0
  76. data/lib/karafka/web/{ui/pro → pro/ui}/views/consumers/consumer/_subscription_group.erb +20 -9
  77. data/lib/karafka/web/pro/ui/views/consumers/consumer/_title.erb +5 -0
  78. data/lib/karafka/web/pro/ui/views/consumers/controls.erb +67 -0
  79. data/lib/karafka/web/{ui/pro → pro/ui}/views/consumers/details.erb +6 -1
  80. data/lib/karafka/web/pro/ui/views/consumers/index.erb +39 -0
  81. data/lib/karafka/web/{ui/pro → pro/ui}/views/consumers/pending_jobs.erb +15 -7
  82. data/lib/karafka/web/pro/ui/views/consumers/performance.erb +52 -0
  83. data/lib/karafka/web/{ui/pro → pro/ui}/views/consumers/running_jobs.erb +15 -7
  84. data/lib/karafka/web/pro/ui/views/consumers/subscriptions.erb +28 -0
  85. data/lib/karafka/web/{ui/pro → pro/ui}/views/dashboard/index.erb +10 -10
  86. data/lib/karafka/web/pro/ui/views/dlq/_no_topics.erb +7 -0
  87. data/lib/karafka/web/{ui/pro → pro/ui}/views/dlq/index.erb +1 -1
  88. data/lib/karafka/web/{ui/pro → pro/ui}/views/errors/_error.erb +2 -6
  89. data/lib/karafka/web/pro/ui/views/errors/_table.erb +23 -0
  90. data/lib/karafka/web/pro/ui/views/explorer/_failed_deserialization.erb +4 -0
  91. data/lib/karafka/web/{ui/pro → pro/ui}/views/explorer/_message.erb +7 -1
  92. data/lib/karafka/web/pro/ui/views/explorer/_no_topics.erb +5 -0
  93. data/lib/karafka/web/{ui/pro → pro/ui}/views/explorer/index.erb +1 -6
  94. data/lib/karafka/web/{ui/pro → pro/ui}/views/explorer/message/_metadata.erb +33 -9
  95. data/lib/karafka/web/{ui/pro → pro/ui}/views/explorer/message/_payload.erb +4 -4
  96. data/lib/karafka/web/{ui/pro → pro/ui}/views/explorer/message/_payload_actions.erb +1 -1
  97. data/lib/karafka/web/pro/ui/views/explorer/messages/_headers.erb +33 -0
  98. data/lib/karafka/web/pro/ui/views/explorer/messages/_key.erb +20 -0
  99. data/lib/karafka/web/pro/ui/views/explorer/partition/_cleaned.erb +5 -0
  100. data/lib/karafka/web/pro/ui/views/explorer/partition/_empty.erb +5 -0
  101. data/lib/karafka/web/pro/ui/views/explorer/partition/_messages.erb +21 -0
  102. data/lib/karafka/web/pro/ui/views/explorer/topic/_empty.erb +5 -0
  103. data/lib/karafka/web/pro/ui/views/explorer/topic/_limited.erb +10 -0
  104. data/lib/karafka/web/{ui/pro → pro/ui}/views/health/_breadcrumbs.erb +8 -0
  105. data/lib/karafka/web/pro/ui/views/health/_no_data.erb +7 -0
  106. data/lib/karafka/web/{ui/pro → pro/ui}/views/health/_partition.erb +1 -1
  107. data/lib/karafka/web/{ui/pro → pro/ui}/views/health/_partition_lags.erb +6 -3
  108. data/lib/karafka/web/{ui/pro → pro/ui}/views/health/_tabs.erb +11 -1
  109. data/lib/karafka/web/{ui/pro → pro/ui}/views/health/changes.erb +15 -10
  110. data/lib/karafka/web/pro/ui/views/health/cluster_lags.erb +54 -0
  111. data/lib/karafka/web/{ui/pro → pro/ui}/views/health/lags.erb +16 -10
  112. data/lib/karafka/web/{ui/pro → pro/ui}/views/health/offsets.erb +17 -14
  113. data/lib/karafka/web/{ui/pro → pro/ui}/views/health/overview.erb +23 -9
  114. data/lib/karafka/web/{ui/pro → pro/ui}/views/jobs/_job.erb +1 -1
  115. data/lib/karafka/web/pro/ui/views/jobs/_no_jobs.erb +7 -0
  116. data/lib/karafka/web/{ui/pro → pro/ui}/views/jobs/pending.erb +12 -8
  117. data/lib/karafka/web/{ui/pro → pro/ui}/views/jobs/running.erb +12 -8
  118. data/lib/karafka/web/{ui/pro → pro/ui}/views/routing/_consumer_group.erb +2 -2
  119. data/lib/karafka/web/{ui/pro → pro/ui}/views/routing/index.erb +1 -1
  120. data/lib/karafka/web/{ui/pro → pro/ui}/views/routing/show.erb +1 -1
  121. data/lib/karafka/web/{ui/pro → pro/ui}/views/shared/_navigation.erb +14 -0
  122. data/lib/karafka/web/pro/ui/views/topics/_breadcrumbs.erb +37 -0
  123. data/lib/karafka/web/pro/ui/views/topics/_partition.erb +16 -0
  124. data/lib/karafka/web/pro/ui/views/topics/_tabs.erb +37 -0
  125. data/lib/karafka/web/pro/ui/views/topics/_topic.erb +12 -0
  126. data/lib/karafka/web/pro/ui/views/topics/config.erb +29 -0
  127. data/lib/karafka/web/pro/ui/views/topics/distribution/_badges.erb +7 -0
  128. data/lib/karafka/web/pro/ui/views/topics/distribution/_chart.erb +2 -0
  129. data/lib/karafka/web/pro/ui/views/topics/distribution/_empty_partitions.erb +1 -0
  130. data/lib/karafka/web/pro/ui/views/topics/distribution/_limited.erb +10 -0
  131. data/lib/karafka/web/pro/ui/views/topics/distribution/_partition.erb +10 -0
  132. data/lib/karafka/web/pro/ui/views/topics/distribution.erb +47 -0
  133. data/lib/karafka/web/pro/ui/views/topics/index.erb +16 -0
  134. data/lib/karafka/web/pro/ui/views/topics/replication.erb +28 -0
  135. data/lib/karafka/web/processing/consumers/aggregators/base.rb +1 -1
  136. data/lib/karafka/web/processing/consumers/aggregators/metrics.rb +1 -1
  137. data/lib/karafka/web/processing/consumers/aggregators/state.rb +4 -4
  138. data/lib/karafka/web/tracking/consumers/contracts/report.rb +1 -1
  139. data/lib/karafka/web/tracking/consumers/contracts/subscription_group.rb +1 -1
  140. data/lib/karafka/web/tracking/consumers/listeners/booting.rb +36 -0
  141. data/lib/karafka/web/tracking/consumers/listeners/errors.rb +2 -2
  142. data/lib/karafka/web/tracking/consumers/reporter.rb +3 -3
  143. data/lib/karafka/web/tracking/consumers/sampler.rb +10 -4
  144. data/lib/karafka/web/tracking/contracts/error.rb +1 -1
  145. data/lib/karafka/web/tracking/producers/listeners/booting.rb +26 -0
  146. data/lib/karafka/web/tracking/producers/listeners/errors.rb +2 -2
  147. data/lib/karafka/web/tracking/producers/reporter.rb +1 -1
  148. data/lib/karafka/web/tracking/producers/sampler.rb +1 -1
  149. data/lib/karafka/web/tracking/sampler.rb +3 -3
  150. data/lib/karafka/web/tracking/scheduler.rb +0 -5
  151. data/lib/karafka/web/ui/app.rb +13 -9
  152. data/lib/karafka/web/ui/base.rb +1 -0
  153. data/lib/karafka/web/ui/controllers/{base.rb → base_controller.rb} +15 -2
  154. data/lib/karafka/web/ui/controllers/{become_pro.rb → become_pro_controller.rb} +1 -1
  155. data/lib/karafka/web/ui/controllers/{cluster.rb → cluster_controller.rb} +4 -4
  156. data/lib/karafka/web/ui/controllers/{consumers.rb → consumers_controller.rb} +3 -3
  157. data/lib/karafka/web/ui/controllers/{dashboard.rb → dashboard_controller.rb} +1 -1
  158. data/lib/karafka/web/ui/controllers/{errors.rb → errors_controller.rb} +2 -2
  159. data/lib/karafka/web/ui/controllers/{jobs.rb → jobs_controller.rb} +5 -5
  160. data/lib/karafka/web/ui/controllers/{routing.rb → routing_controller.rb} +2 -2
  161. data/lib/karafka/web/ui/controllers/{status.rb → status_controller.rb} +1 -1
  162. data/lib/karafka/web/ui/helpers/alerts_helper.rb +23 -0
  163. data/lib/karafka/web/ui/helpers/application_helper.rb +55 -1
  164. data/lib/karafka/web/ui/lib/paginations/offset_based.rb +3 -4
  165. data/lib/karafka/web/ui/lib/safe_runner.rb +59 -0
  166. data/lib/karafka/web/ui/models/broker.rb +66 -0
  167. data/lib/karafka/web/ui/models/health.rb +28 -2
  168. data/lib/karafka/web/ui/models/message.rb +9 -3
  169. data/lib/karafka/web/ui/models/process.rb +19 -5
  170. data/lib/karafka/web/ui/models/processes.rb +2 -2
  171. data/lib/karafka/web/ui/models/topic.rb +78 -0
  172. data/lib/karafka/web/ui/public/javascripts/application.js +18 -1
  173. data/lib/karafka/web/ui/public/javascripts/charts/data_formatting_utility.js +71 -0
  174. data/lib/karafka/web/ui/public/javascripts/charts/dataset_state_manager.js +49 -0
  175. data/lib/karafka/web/ui/public/javascripts/charts/types/bar.js +123 -0
  176. data/lib/karafka/web/ui/public/javascripts/charts/types/line.js +143 -0
  177. data/lib/karafka/web/ui/public/javascripts/charts.js +10 -325
  178. data/lib/karafka/web/ui/public/javascripts/live_poll.js +5 -5
  179. data/lib/karafka/web/ui/public/javascripts/tabs_manager.js +57 -0
  180. data/lib/karafka/web/ui/public/stylesheets/application.css +7 -6
  181. data/lib/karafka/web/ui/views/cluster/_breadcrumbs.erb +3 -3
  182. data/lib/karafka/web/ui/views/cluster/_no_partitions.erb +1 -3
  183. data/lib/karafka/web/ui/views/cluster/_tabs.erb +3 -3
  184. data/lib/karafka/web/ui/views/cluster/brokers.erb +19 -19
  185. data/lib/karafka/web/ui/views/cluster/replication.erb +37 -0
  186. data/lib/karafka/web/ui/views/consumers/_assignments_badges.erb +24 -0
  187. data/lib/karafka/web/ui/views/consumers/_consumer.erb +2 -15
  188. data/lib/karafka/web/ui/views/consumers/_counters.erb +1 -1
  189. data/lib/karafka/web/ui/views/consumers/_summary.erb +5 -5
  190. data/lib/karafka/web/ui/views/consumers/index.erb +22 -20
  191. data/lib/karafka/web/ui/views/dashboard/index.erb +9 -9
  192. data/lib/karafka/web/ui/views/errors/_cleaned.erb +1 -3
  193. data/lib/karafka/web/ui/views/errors/_error.erb +2 -6
  194. data/lib/karafka/web/ui/views/errors/_no_errors.erb +1 -3
  195. data/lib/karafka/web/ui/views/errors/index.erb +22 -20
  196. data/lib/karafka/web/ui/views/jobs/_job.erb +4 -1
  197. data/lib/karafka/web/ui/views/jobs/_no_jobs.erb +1 -3
  198. data/lib/karafka/web/ui/views/jobs/pending.erb +4 -3
  199. data/lib/karafka/web/ui/views/jobs/running.erb +4 -3
  200. data/lib/karafka/web/ui/views/routing/_consumer_group.erb +2 -2
  201. data/lib/karafka/web/ui/views/routing/index.erb +1 -1
  202. data/lib/karafka/web/ui/views/routing/show.erb +1 -1
  203. data/lib/karafka/web/ui/views/shared/_become_pro.erb +3 -3
  204. data/lib/karafka/web/ui/views/shared/_header.erb +16 -10
  205. data/lib/karafka/web/ui/views/shared/_navigation.erb +17 -3
  206. data/lib/karafka/web/ui/views/shared/_not_a_message.erb +5 -0
  207. data/lib/karafka/web/ui/views/shared/alerts/_info.erb +3 -0
  208. data/lib/karafka/web/ui/views/shared/charts/_bar.erb +7 -0
  209. data/lib/karafka/web/ui/views/shared/{_chart.erb → charts/_line.erb} +1 -1
  210. data/lib/karafka/web/ui/views/shared/exceptions/not_found.erb +1 -1
  211. data/lib/karafka/web/ui/views/status/show.erb +1 -1
  212. data/lib/karafka/web/version.rb +1 -1
  213. data/lib/karafka/web.rb +19 -2
  214. data.tar.gz.sig +0 -0
  215. metadata +191 -120
  216. metadata.gz.sig +0 -0
  217. data/lib/karafka/web/ui/pro/controllers/dlq.rb +0 -43
  218. data/lib/karafka/web/ui/pro/views/consumers/consumer/_no_jobs.erb +0 -9
  219. data/lib/karafka/web/ui/pro/views/consumers/consumer/_no_subscriptions.erb +0 -9
  220. data/lib/karafka/web/ui/pro/views/consumers/index.erb +0 -36
  221. data/lib/karafka/web/ui/pro/views/consumers/subscriptions.erb +0 -23
  222. data/lib/karafka/web/ui/pro/views/dlq/_no_topics.erb +0 -9
  223. data/lib/karafka/web/ui/pro/views/errors/_table.erb +0 -21
  224. data/lib/karafka/web/ui/pro/views/explorer/_failed_deserialization.erb +0 -4
  225. data/lib/karafka/web/ui/pro/views/explorer/_no_topics.erb +0 -7
  226. data/lib/karafka/web/ui/pro/views/explorer/messages/_headers.erb +0 -15
  227. data/lib/karafka/web/ui/pro/views/explorer/messages/_key.erb +0 -12
  228. data/lib/karafka/web/ui/pro/views/explorer/partition/_cleaned.erb +0 -3
  229. data/lib/karafka/web/ui/pro/views/explorer/partition/_empty.erb +0 -3
  230. data/lib/karafka/web/ui/pro/views/explorer/partition/_messages.erb +0 -19
  231. data/lib/karafka/web/ui/pro/views/explorer/topic/_empty.erb +0 -3
  232. data/lib/karafka/web/ui/pro/views/explorer/topic/_limited.erb +0 -4
  233. data/lib/karafka/web/ui/pro/views/health/_no_data.erb +0 -9
  234. data/lib/karafka/web/ui/pro/views/jobs/_no_jobs.erb +0 -9
  235. data/lib/karafka/web/ui/public/javascripts/tabs.js +0 -59
  236. data/lib/karafka/web/ui/views/cluster/topics.erb +0 -35
  237. /data/lib/karafka/web/{ui/pro → pro/ui}/views/consumers/consumer/_consumer_group.erb +0 -0
  238. /data/lib/karafka/web/{ui/pro → pro/ui}/views/consumers/consumer/_job.erb +0 -0
  239. /data/lib/karafka/web/{ui/pro → pro/ui}/views/consumers/consumer/_metrics.erb +0 -0
  240. /data/lib/karafka/web/{ui/pro → pro/ui}/views/consumers/consumer/_partition.erb +0 -0
  241. /data/lib/karafka/web/{ui/pro → pro/ui}/views/consumers/consumer/_stopped.erb +0 -0
  242. /data/lib/karafka/web/{ui/pro → pro/ui}/views/consumers/consumer/_tabs.erb +0 -0
  243. /data/lib/karafka/web/{ui/pro → pro/ui}/views/dlq/_breadcrumbs.erb +0 -0
  244. /data/lib/karafka/web/{ui/pro → pro/ui}/views/dlq/_topic.erb +0 -0
  245. /data/lib/karafka/web/{ui/pro → pro/ui}/views/errors/_breadcrumbs.erb +0 -0
  246. /data/lib/karafka/web/{ui/pro → pro/ui}/views/errors/_partition_option.erb +0 -0
  247. /data/lib/karafka/web/{ui/pro → pro/ui}/views/errors/_title_with_select.erb +0 -0
  248. /data/lib/karafka/web/{ui/pro → pro/ui}/views/errors/index.erb +0 -0
  249. /data/lib/karafka/web/{ui/pro → pro/ui}/views/errors/partition.erb +0 -0
  250. /data/lib/karafka/web/{ui/pro → pro/ui}/views/errors/show.erb +0 -0
  251. /data/lib/karafka/web/{ui/pro → pro/ui}/views/explorer/_breadcrumbs.erb +0 -0
  252. /data/lib/karafka/web/{ui/pro → pro/ui}/views/explorer/_filtered.erb +0 -0
  253. /data/lib/karafka/web/{ui/pro → pro/ui}/views/explorer/_partition_option.erb +0 -0
  254. /data/lib/karafka/web/{ui/pro → pro/ui}/views/explorer/_topic.erb +0 -0
  255. /data/lib/karafka/web/{ui/pro → pro/ui}/views/explorer/message/_message_actions.erb +0 -0
  256. /data/lib/karafka/web/{ui/pro → pro/ui}/views/explorer/messages/_detail.erb +0 -0
  257. /data/lib/karafka/web/{ui/pro → pro/ui}/views/explorer/partition/_details.erb +0 -0
  258. /data/lib/karafka/web/{ui/pro → pro/ui}/views/explorer/partition.erb +0 -0
  259. /data/lib/karafka/web/{ui/pro → pro/ui}/views/explorer/show.erb +0 -0
  260. /data/lib/karafka/web/{ui/pro → pro/ui}/views/explorer/topic/_details.erb +0 -0
  261. /data/lib/karafka/web/{ui/pro → pro/ui}/views/explorer/topic.erb +0 -0
  262. /data/lib/karafka/web/{ui/pro → pro/ui}/views/health/_consumer_group_header.erb +0 -0
  263. /data/lib/karafka/web/{ui/pro → pro/ui}/views/health/_partition_offset.erb +0 -0
  264. /data/lib/karafka/web/{ui/pro → pro/ui}/views/health/_partition_times.erb +0 -0
  265. /data/lib/karafka/web/{ui/pro → pro/ui}/views/routing/_detail.erb +0 -0
  266. /data/lib/karafka/web/{ui/pro → pro/ui}/views/routing/_topic.erb +0 -0
  267. /data/lib/karafka/web/ui/public/javascripts/{bootstrap.min.js → libs/bootstrap.min.js} +0 -0
  268. /data/lib/karafka/web/ui/public/javascripts/{chart.min.js → libs/chart.min.js} +0 -0
  269. /data/lib/karafka/web/ui/public/javascripts/{datepicker.js → libs/datepicker.js} +0 -0
  270. /data/lib/karafka/web/ui/public/javascripts/{highlight.min.js → libs/highlight.min.js} +0 -0
  271. /data/lib/karafka/web/ui/public/javascripts/{timeago.min.js → libs/timeago.min.js} +0 -0
  272. /data/lib/karafka/web/ui/public/stylesheets/{bootstrap.min.css → libs/bootstrap.min.css} +0 -0
  273. /data/lib/karafka/web/ui/public/stylesheets/{datepicker.min.css → libs/datepicker.min.css} +0 -0
  274. /data/lib/karafka/web/ui/public/stylesheets/{highlight.min.css → libs/highlight.min.css} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69148848d89de8a7c5a1cebec7d3f5c0c60e3bd85caa41eedea8b5082dd6bf85
4
- data.tar.gz: c0f6acfdd3e732ebfc29a6e954cd8a1f8d2c75dff77eba28978a99d6394d4087
3
+ metadata.gz: bb0a26726917ff55929bb34bf81e4a0a7b6f1e5db0e6c34fe11b85c2601cd9df
4
+ data.tar.gz: 20664c3ce3931cc4c770af78fe1ced92690cf5dd8f58bf0f24b7a05ecb05982a
5
5
  SHA512:
6
- metadata.gz: a89e22500fc5fedf8e432b666a84cf092d13c9b2747a4d08dc983d8ffba2f077781f06a131631b6315c64764bc00b7d06265a4d9fcd8c11bdd74d47eda5041f9
7
- data.tar.gz: 7d29af2874b1df83af78fee69af89021bdcd1fa705686370f59ab276ee6808eef98e4a0b98dd273158888b472cea203bcca84f494e84c178f7733404b080166a
6
+ metadata.gz: b566ebc2f5c500e31fe4b20106fdf9adb022f89079109cd3131c6dd7950dbddedbbea1c389764c9e5c197074073da606aec9b3029303877e5b68123447bbf28b
7
+ data.tar.gz: 341b8acc29d5cd21c93d84227b86b4674390c50e3f43920837d5b3caaa286676cace4ea35d66c67349c04431733162a8720340ab2c297898a9a7548d5cc937df
checksums.yaml.gz.sig CHANGED
Binary file
@@ -26,7 +26,6 @@ jobs:
26
26
  - '3.2'
27
27
  - '3.1'
28
28
  - '3.0'
29
- - '2.7'
30
29
  include:
31
30
  - ruby: '3.3'
32
31
  coverage: 'true'
@@ -35,9 +34,9 @@ jobs:
35
34
  - name: Install package dependencies
36
35
  run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
37
36
 
38
- - name: Start Kafka with docker-compose
37
+ - name: Start Kafka with docker compose
39
38
  run: |
40
- docker-compose up -d || (sleep 5 && docker-compose up -d)
39
+ docker compose up -d || (sleep 5 && docker compose up -d)
41
40
 
42
41
  - name: Set up Ruby
43
42
  uses: ruby/setup-ruby@v1
@@ -48,25 +47,15 @@ jobs:
48
47
 
49
48
  - name: Install latest bundler
50
49
  run: |
51
- if [[ "$(ruby -v | awk '{print $2}')" == 2.7.8* ]]; then
52
- gem install bundler -v 2.4.22 --no-document
53
- gem update --system 3.4.22 --no-document
54
- else
55
- gem install bundler --no-document
56
- gem update --system --no-document
57
- fi
50
+ gem install bundler --no-document
51
+ gem update --system --no-document
58
52
 
59
53
  bundle config set without 'tools benchmarks docs'
60
54
 
61
55
  - name: Bundle install
62
56
  run: |
63
57
  bundle config set without development
64
-
65
- if [[ "$(ruby -v | awk '{print $2}')" == 2.7.8* ]]; then
66
- BUNDLER_VERSION=2.4.22 bundle install --jobs 4 --retry 3
67
- else
68
- bundle install --jobs 4 --retry 3
69
- fi
58
+ bundle install --jobs 4 --retry 3
70
59
 
71
60
  - name: Wait for Kafka
72
61
  run: |
data/CHANGELOG.md CHANGED
@@ -1,5 +1,52 @@
1
1
  # Karafka Web changelog
2
2
 
3
+ ## 0.9.0 (Unreleased)
4
+ - **[Breaking]** Drop Ruby `2.7` support.
5
+ - **[Feature]** Provide ability to stop and quiet running consumers (Pro).
6
+ - **[Feature]** Provide ability to probe (get backtraces) of any running consumer (Pro).
7
+ - **[Feature]** Provide cluster lags in Health (Pro).
8
+ - **[Feature]** Provide ability to inspect cluster nodes configuration (Pro).
9
+ - **[Feature]** Provide ability to inspect cluster topics configuration (Pro).
10
+ - **[Feature]** Provide messages distribution graph statistics for topics (Pro).
11
+ - [Enhancement] Provide first offset in the OSS jobs tab.
12
+ - [Enhancement] Support failover for custom deserialization of headers and key in the explorer (Pro).
13
+ - [Enhancement] Support failover for custom deserialization of headers and key in the explorer (Pro).
14
+ - [Enhancement] Limit length of `key` presented in the list view of the explorer.
15
+ - [Enhancement] Improve responsiveness on big screens by increasing max width.
16
+ - [Enhancement] Auto-qualify topics with dlq/dead_letter case insensitive name components to DLQ view.
17
+ - [Enhancement] Make tables responsive.
18
+ - [Enhancement] Provide page titles for ease of navigation.
19
+ - [Change] Rename Cluster => Topics to Cluster => Replication to better align with what is shows.
20
+ - [Change] Make support messages more entertaining.
21
+ - [Refactor] Normalize what is process name and process id.
22
+ - [Refactor] Create one `pro/` namespace for all Web related sub-modules.
23
+ - [Refactor] Extract alerts into a common component.
24
+ - [Refactor] Generalize charts generation.
25
+ - [Fix] Fix invalid return when paginating with offsets.
26
+ - [Fix] Improve responsiveness of summary in the consumers view for lower resolutions.
27
+ - [Fix] Align pages titles format.
28
+ - [Fix] Fix missing link from lag counter to Health.
29
+ - [Fix] Fix a case where on mobile charts would not load correctly.
30
+ - [Fix] Fix cases where long consumer names would break UI.
31
+ - [Fix] Explorer deserializer wrongly selected for pattern matched topics.
32
+ - [Fix] Fix 404 error page invalid recommendation of `install` instead of `migrate`.
33
+ - [Fix] Fix dangling `console.log`.
34
+ - [Fix] Fix a case where consumer assignments would not be truncated on the consumers view.
35
+
36
+ ### Upgrade Notes
37
+
38
+ This is a **major** release that brings many things to the table.
39
+
40
+ This version of the Karafka Web UI should be upgraded together with Karafka. All upgrade documentation for Karafka and Web UI `0.9` can be found [here](https://karafka.io/docs/Upgrades-2.4/).
41
+
42
+ ## 0.8.2 (2024-02-16)
43
+ - [Enhancement] Defer scheduler background thread creation until needed allowing for forks.
44
+ - [Enhancement] Tag forks with fork indication + ppid reference when operating in swarm.
45
+ - [Fix] Fix issue where Health tabs would not be visible when no data reported.
46
+ - [Fix] Stopped processes subscriptions lacks indicator of no groups.
47
+ - [Fix] Terminated process state not supported in the web ui.
48
+ - [Fix] Rebalance reason can be empty on a SG when no network.
49
+
3
50
  ## 0.8.1 (2024-02-01)
4
51
  - [Enhancement] Introduce "Lags" health view.
5
52
  - [Enhancement] Remove "Stored Lag" and "Committed Offset" from Health Overview due to Lags Tab.
data/Gemfile.lock CHANGED
@@ -1,17 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-web (0.8.1)
4
+ karafka-web (0.9.0.rc1)
5
5
  erubi (~> 1.4)
6
- karafka (>= 2.3.0, < 2.4.0)
7
- karafka-core (>= 2.3.0, < 2.4.0)
6
+ karafka (>= 2.4.0.beta1, < 2.5.0)
7
+ karafka-core (>= 2.4.0.rc1, < 2.5.0)
8
8
  roda (~> 3.68, >= 3.69)
9
9
  tilt (~> 2.0)
10
10
 
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- activesupport (7.1.3)
14
+ activesupport (7.1.3.2)
15
15
  base64
16
16
  bigdecimal
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -22,56 +22,54 @@ GEM
22
22
  mutex_m
23
23
  tzinfo (~> 2.0)
24
24
  base64 (0.2.0)
25
- bigdecimal (3.1.6)
25
+ bigdecimal (3.1.7)
26
26
  byebug (11.1.3)
27
27
  concurrent-ruby (1.2.3)
28
28
  connection_pool (2.4.1)
29
- diff-lcs (1.5.0)
29
+ diff-lcs (1.5.1)
30
30
  docile (1.4.0)
31
- drb (2.2.0)
32
- ruby2_keywords
31
+ drb (2.2.1)
33
32
  erubi (1.12.0)
34
- factory_bot (6.4.5)
33
+ factory_bot (6.4.6)
35
34
  activesupport (>= 5.0.0)
36
35
  ffi (1.16.3)
37
- i18n (1.14.1)
36
+ i18n (1.14.4)
38
37
  concurrent-ruby (~> 1.0)
39
- karafka (2.3.0)
40
- karafka-core (>= 2.3.0, < 2.4.0)
41
- waterdrop (>= 2.6.12, < 3.0.0)
38
+ karafka (2.4.0.beta1)
39
+ karafka-core (>= 2.4.0.rc1, < 2.5.0)
40
+ waterdrop (>= 2.7.0.rc1, < 3.0.0)
42
41
  zeitwerk (~> 2.3)
43
- karafka-core (2.3.0)
44
- karafka-rdkafka (>= 0.14.8, < 0.15.0)
45
- karafka-rdkafka (0.14.8)
42
+ karafka-core (2.4.0.rc1)
43
+ karafka-rdkafka (>= 0.15.0.rc1, < 0.16.0)
44
+ karafka-rdkafka (0.15.0.rc1)
46
45
  ffi (~> 1.15)
47
46
  mini_portile2 (~> 2.6)
48
47
  rake (> 12)
49
48
  mini_portile2 (2.8.5)
50
- minitest (5.21.2)
49
+ minitest (5.22.3)
51
50
  mutex_m (0.2.0)
52
- rack (3.0.8)
51
+ rack (3.0.10)
53
52
  rack-test (2.1.0)
54
53
  rack (>= 1.3)
55
54
  rackup (0.2.3)
56
55
  rack (>= 3.0.0.beta1)
57
56
  webrick
58
57
  rake (13.1.0)
59
- roda (3.76.0)
58
+ roda (3.78.0)
60
59
  rack
61
- rspec (3.12.0)
62
- rspec-core (~> 3.12.0)
63
- rspec-expectations (~> 3.12.0)
64
- rspec-mocks (~> 3.12.0)
65
- rspec-core (3.12.2)
66
- rspec-support (~> 3.12.0)
67
- rspec-expectations (3.12.3)
60
+ rspec (3.13.0)
61
+ rspec-core (~> 3.13.0)
62
+ rspec-expectations (~> 3.13.0)
63
+ rspec-mocks (~> 3.13.0)
64
+ rspec-core (3.13.0)
65
+ rspec-support (~> 3.13.0)
66
+ rspec-expectations (3.13.0)
68
67
  diff-lcs (>= 1.2.0, < 2.0)
69
- rspec-support (~> 3.12.0)
70
- rspec-mocks (3.12.6)
68
+ rspec-support (~> 3.13.0)
69
+ rspec-mocks (3.13.0)
71
70
  diff-lcs (>= 1.2.0, < 2.0)
72
- rspec-support (~> 3.12.0)
73
- rspec-support (3.12.1)
74
- ruby2_keywords (0.0.5)
71
+ rspec-support (~> 3.13.0)
72
+ rspec-support (3.13.1)
75
73
  simplecov (0.22.0)
76
74
  docile (~> 1.1)
77
75
  simplecov-html (~> 0.11)
@@ -81,11 +79,11 @@ GEM
81
79
  tilt (2.3.0)
82
80
  tzinfo (2.0.6)
83
81
  concurrent-ruby (~> 1.0)
84
- waterdrop (2.6.12)
85
- karafka-core (>= 2.2.3, < 3.0.0)
82
+ waterdrop (2.7.0.rc1)
83
+ karafka-core (>= 2.4.0.rc1, < 3.0.0)
86
84
  zeitwerk (~> 2.3)
87
85
  webrick (1.8.1)
88
- zeitwerk (2.6.12)
86
+ zeitwerk (2.6.13)
89
87
 
90
88
  PLATFORMS
91
89
  ruby
@@ -101,4 +99,4 @@ DEPENDENCIES
101
99
  simplecov
102
100
 
103
101
  BUNDLED WITH
104
- 2.5.4
102
+ 2.5.7
data/LICENSE CHANGED
@@ -4,14 +4,14 @@ Karafka Web is part of Karafka and it is an Open Source project licensed under t
4
4
  the LGPLv3 license. Please see <https://github.com/karafka/karafka/blob/master/LGPL>
5
5
  for license text.
6
6
 
7
- Karafka has also commercial-friendly license, commercial support and commercial components.
7
+ Karafka and Karafka Web have also commercial-friendly license, commercial support and commercial components.
8
8
 
9
- All of the commercial components are present in the lib/karafka/pro and lib/karafka/web/ui/pro
9
+ All of the commercial components are present in the lib/karafka/pro and lib/karafka/web/pro
10
10
  directory of this repository and their usage requires commercial license agreement.
11
11
 
12
12
  By sending a pull request to the pro components, you are agreeing to transfer the copyright of your
13
13
  code to Maciej Mensfeld.
14
14
 
15
- You can find the commercial license in LICENSE-COMM.
15
+ You can find the commercial license in LICENSE-COMM <https://github.com/karafka/karafka/blob/master/LICENSE-COMM>.
16
16
 
17
17
  Please see https://karafka.io for purchasing options.
data/bin/rspecs CHANGED
@@ -3,4 +3,4 @@
3
3
  set -e
4
4
 
5
5
  SPECS_TYPE=regular bundle exec rspec --exclude-pattern "**/pro/**/*_spec.rb"
6
- SPECS_TYPE=pro bundle exec rspec --pattern "**/pro/**/*_spec.rb"
6
+ SPECS_TYPE=pro bundle exec rspec spec/lib/karafka/web/pro
@@ -0,0 +1,11 @@
1
+ en:
2
+ validations:
3
+ config:
4
+ missing: needs to be present
5
+
6
+ commanding.active_format: needs to be either true or false
7
+ commanding.consumer_group_format: 'needs to be a string with a Kafka accepted format'
8
+ commanding.max_wait_time_format: needs to be an integer bigger than 0
9
+ commanding.pause_timeout_format: needs to be an integer bigger than 0
10
+ key_must_be_a_symbol: All keys under the kafka settings scope need to be symbols
11
+ commanding.kafka_format: needs to be a filled hash
@@ -0,0 +1,62 @@
1
+ en:
2
+ slogans:
3
+ - "Unlock the full potential of Karafka with our Pro plan – Your support fuels innovation!"
4
+ - "Elevate your Karafka experience! Go Pro and access exclusive features today."
5
+ - "Support Karafka's future developments by upgrading to Pro. Together, we can achieve more!"
6
+ - "Maximize your productivity with Karafka Pro. Upgrade today for a seamless experience."
7
+ - "Be a part of something bigger. Your Pro subscription helps me innovate continuously."
8
+ - "Unlock premium features and dedicated support by upgrading to Karafka Pro."
9
+ - "Experience the best of Karafka with Pro: More features, more power."
10
+ - "Karafka Pro awaits with open arms. Upgrade now for a richer development experience."
11
+ - "Lead, innovate, and excel with Karafka Pro. Upgrade today to unlock your potential."
12
+ - "Your projects deserve the best. Upgrade to Karafka Pro for unmatched features."
13
+ - "Speed up your development timeline with Karafka's Pro advanced tools. Upgrade for efficiency!"
14
+ - "Get more done quickly with Karafka's Pro exclusive features. Upgrade to accelerate."
15
+ - "Fast-forward your projects with Karafka Pro. Efficiency is just an upgrade away."
16
+ - "Elevate your coding speed and project quality with Karafka Pro. Time to upgrade!"
17
+ - "Karafka Pro: Because your time is invaluable. Upgrade for a seamless, speedy workflow."
18
+ - "Your Pro upgrade powers my innovation - support Karafka's growth and OSS commitment."
19
+ - "Go Pro and become a pillar of the Karafka ecosystem. Support development, support OSS."
20
+ - "By choosing Pro, you're fueling our ability to enhance and expand the Karafka ecosystem."
21
+ - "Support us in shaping the future of Karafka. Your Pro subscription invests in OSS excellence."
22
+ - "Your support through Pro enables me to innovate and give back to the OSS community."
23
+ - "Enhance your impact on the OSS world. Upgrade to Karafka Pro and support our ecosystem."
24
+ - "Every Pro subscriber helps us invest more in Karafka and the broader OSS community."
25
+ - "Upgrade to Pro: Fuel Karafka's innovation and our dedication to OSS progress."
26
+ - "Your Pro subscription helps me reinvest in Karafka and contribute more to OSS."
27
+ - "Leverage Delayed Topics in Karafka Pro for precise message processing timing."
28
+ - "Automatically manage message lifecycles with the Expiring Messages feature in Karafka Pro."
29
+ - "Control consumption pace wisely with Rate Limiting, available in Karafka Pro."
30
+ - "Quickly access data with the Iterator API, a unique Karafka Pro feature."
31
+ - "Enhance throughput with Multiplexing, enabling parallel processing in Karafka Pro."
32
+ - "Need to process data faster? Explore Karafka Pro for parallel processing enhancements."
33
+ - "Struggling with data integrity? Karafka's Pro transaction features ensure reliability."
34
+ - "Want more control over message timing? Delayed Topics in Karafka Pro make scheduling easy."
35
+ - "Need to automate regular tasks? Periodic Jobs in Karafka Pro have got you covered."
36
+ - "Worried about message overload? Karafka's Pro Expiring Messages keep your queues clean."
37
+ - "Want to filter messages efficiently? Filtering API in Pro makes it simple."
38
+ - "Concerned about memory during batch operations? Cleaner API in Karafka Pro is the answer."
39
+ - "Need to increase processing speed? Karafka's Pro Multiplexing feature boosts throughput."
40
+ - "Looking for better message management? Enhanced Dead Letter Queue in Karafka Pro is key."
41
+ - "Concerned about Karafka licensing? Karafka Pro offers a commercial-friendly option."
42
+ - "Need coupled message operations? Transactions in Karafka Pro enhance data integrity."
43
+ - "Are you Concerned about managing large data flows? Virtual Partitions in Karafka Pro simplify data processing, offering unparalleled efficiency and scalability."
44
+ - "Looking for flexible scheduling solutions? Karafka's Pro Periodic Jobs feature allows for precise task timing and execution, enhancing your application's performance and reliability."
45
+ - "Need advanced routing capabilities? Routing Patterns in Karafka Pro provide dynamic message routing, improving your system's adaptability and efficiency."
46
+ - "Are you Seeking to control your workload? With Rate Limiting in Karafka Pro, you can manage and balance your system's load effectively, ensuring optimal performance under any conditions."
47
+ - "Need quick data access methods? The Iterator API in Karafka Pro provides efficient data retrieval methods."
48
+ - "Want more nuanced error handling? Discover Granular Backoffs in Karafka Pro, allowing for detailed control over retry mechanisms and error recovery processes."
49
+ - "Need a boost in data processing speed? Multiplexing in Karafka Pro enables parallel processing, significantly increasing throughput and reducing processing times."
50
+ - "Need advanced monitoring and management? Karafka Pro goes beyond basic features, offering comprehensive tools for detailed insight and control over your Kafka ecosystem."
51
+ - "Let's Build the Future of Karafka Together: Your Pro support brings next-gen features to life."
52
+ - "Karafka Pro: A Partnership for Progress. Your subscription drives our development."
53
+ - "With Karafka Pro, you're not just upgrading, you're fueling the future of efficient coding."
54
+ - "Dare to Support, Dare to Grow: Karafka Pro is your contribution to a boundary-pushing ecosystem."
55
+ - "Ivest in Karafka Pro to ensure ongoing enhancements and a dynamic, evolving platform."
56
+ - "Advance with us. Your Karafka Pro subscription is a stepping stone for collective innovation."
57
+ - "Together, we can push boundaries. Support Karafka's growth by upgrading to Pro."
58
+ - "Karafka's continuous improvement is powered by our community. Consider going Pro to contribute."
59
+ - "By choosing Karafka Pro, you're investing in a more robust, feature-rich future for your projects."
60
+ - "Help me help you. Karafka's future developments depend on your support through Pro."
61
+ - "Supporting Karafka through Pro enables me to continually enhance its features and support your business better."
62
+ - "Your upgrade to Karafka Pro directly fuels our capacity to innovate and improve. Let's grow together."
data/docker-compose.yml CHANGED
@@ -3,7 +3,7 @@ version: '2'
3
3
  services:
4
4
  kafka:
5
5
  container_name: kafka
6
- image: confluentinc/cp-kafka:7.5.3
6
+ image: confluentinc/cp-kafka:7.6.0
7
7
 
8
8
  ports:
9
9
  - 9092:9092
data/karafka-web.gemspec CHANGED
@@ -17,13 +17,15 @@ 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.3.0', '< 2.4.0'
21
- spec.add_dependency 'karafka-core', '>= 2.3.0', '< 2.4.0'
20
+ spec.add_dependency 'karafka', '>= 2.4.0.beta1', '< 2.5.0'
21
+ spec.add_dependency 'karafka-core', '>= 2.4.0.rc1', '< 2.5.0'
22
22
  spec.add_dependency 'roda', '~> 3.68', '>= 3.69'
23
23
  spec.add_dependency 'tilt', '~> 2.0'
24
24
 
25
25
  spec.add_development_dependency 'rackup', '~> 0.2'
26
26
 
27
+ spec.required_ruby_version = '>= 3.0.0'
28
+
27
29
  if $PROGRAM_NAME.end_with?('gem')
28
30
  spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem')
29
31
  end
@@ -13,7 +13,7 @@ module Karafka
13
13
 
14
14
  # @return [Class] regular or pro Web engine
15
15
  def engine
16
- ::Karafka.pro? ? Ui::Pro::App : Ui::App
16
+ ::Karafka.pro? ? Pro::Ui::App : Ui::App
17
17
  end
18
18
  end
19
19
  end
@@ -41,6 +41,12 @@ module Karafka
41
41
 
42
42
  # Topic for storing consumers historical metrics info
43
43
  setting :metrics, default: 'karafka_consumers_metrics'
44
+
45
+ # Topic for storing commands and their results
46
+ # This is used only in Pro, however we do setup it in OSS in case of upgrade so the
47
+ # transition from one to another is smooth. Otherwise upgrade would require changes
48
+ # to topics (migration) which may be more complex
49
+ setting :commands, default: 'karafka_consumers_commands'
44
50
  end
45
51
  end
46
52
 
@@ -69,6 +75,7 @@ module Karafka
69
75
 
70
76
  # Listeners needed for the Web UI to track consumer related changes
71
77
  setting :listeners, default: [
78
+ Tracking::Consumers::Listeners::Booting.new,
72
79
  Tracking::Consumers::Listeners::Status.new,
73
80
  Tracking::Consumers::Listeners::Errors.new,
74
81
  Tracking::Consumers::Listeners::Connections.new,
@@ -88,6 +95,7 @@ module Karafka
88
95
 
89
96
  # Listeners needed for the Web UI to track producers related stuff
90
97
  setting :listeners, default: [
98
+ Tracking::Producers::Listeners::Booting.new,
91
99
  Tracking::Producers::Listeners::Errors.new
92
100
  ]
93
101
  end
@@ -136,6 +144,11 @@ module Karafka
136
144
  # Should we display internal topics of Kafka. The once starting with `__`
137
145
  # By default we do not display them as they are not usable from regular users perspective
138
146
  setting :internal_topics, default: false
147
+
148
+ # Should we display cluster lags only for active topics
149
+ # Useful for multi-app setups where the web-ui routing does not match the routing setup
150
+ # of micro-services and topics are not active but lags reporting should be in use
151
+ setting :active_topics_cluster_lags_only, default: true
139
152
  end
140
153
 
141
154
  # How many elements should we display on pages that support pagination
@@ -151,6 +164,12 @@ module Karafka
151
164
  # are dealing with
152
165
  setting :visibility_filter, default: Ui::Models::VisibilityFilter.new
153
166
 
167
+ # Consider any topic matching those names as a DLQ topic for the DLQ view
168
+ # Web UI uses auto DLQ discovery based on routing but this may not be fully operable when
169
+ # using a multi-app setup. This config allows to add extra topics if needed without having
170
+ # to explicitly define routing
171
+ setting :dlq_patterns, default: [/(dlq)|(dead_letter)/i]
172
+
154
173
  # Specific kafka settings that are tuned to operate within the Web UI interface.
155
174
  #
156
175
  # Please do not change them unless you know what you are doing as their misconfiguration
@@ -58,9 +58,15 @@ module Karafka
58
58
  required(:cache) { |val| !val.nil? }
59
59
  required(:per_page) { |val| val.is_a?(Integer) && val >= 1 && val <= 100 }
60
60
 
61
+ required(:dlq_patterns) do |val|
62
+ val.is_a?(Array) &&
63
+ val.all? { |attr| attr.is_a?(String) || attr.is_a?(Regexp) }
64
+ end
65
+
61
66
  nested(:visibility) do
62
67
  required(:filter) { |val| !val.nil? }
63
68
  required(:internal_topics) { |val| [true, false].include?(val) }
69
+ required(:active_topics_cluster_lags_only) { |val| [true, false].include?(val) }
64
70
  end
65
71
  end
66
72
  end
@@ -12,6 +12,7 @@ module Karafka
12
12
  #
13
13
  # @param replication_factor [Integer] replication factor we want to use (1 by default)
14
14
  def install(replication_factor: 1)
15
+ enable!
15
16
  puts
16
17
  puts 'Installing Karafka Web UI...'
17
18
  puts
@@ -21,7 +22,6 @@ module Karafka
21
22
  puts
22
23
  Management::Actions::CreateTopics.new.call(replication_factor)
23
24
  wait_for_topics
24
- enable!
25
25
  Management::Actions::CreateInitialStates.new.call
26
26
  puts
27
27
  puts 'Running data migrations...'
@@ -36,6 +36,7 @@ module Karafka
36
36
  #
37
37
  # @param replication_factor [Integer] replication factor we want to use (1 by default)
38
38
  def migrate(replication_factor: 1)
39
+ enable!
39
40
  puts
40
41
  puts 'Creating necessary topics and populating state data...'
41
42
  puts
@@ -53,6 +54,7 @@ module Karafka
53
54
  # Removes all the Karafka topics and creates them again with the same replication factor
54
55
  # @param replication_factor [Integer] replication factor we want to use (1 by default)
55
56
  def reset(replication_factor: 1)
57
+ enable!
56
58
  puts
57
59
  puts 'Resetting Karafka Web UI...'
58
60
  puts
@@ -71,6 +73,7 @@ module Karafka
71
73
 
72
74
  # Removes all the Karafka Web topics and cleans after itself.
73
75
  def uninstall
76
+ enable!
74
77
  puts
75
78
  puts 'Uninstalling Karafka Web UI...'
76
79
  puts
@@ -20,6 +20,7 @@ module Karafka
20
20
  consumers_states_topic = ::Karafka::Web.config.topics.consumers.states
21
21
  consumers_metrics_topic = ::Karafka::Web.config.topics.consumers.metrics
22
22
  consumers_reports_topic = ::Karafka::Web.config.topics.consumers.reports
23
+ consumers_commands_topic = ::Karafka::Web.config.topics.consumers.commands
23
24
  errors_topic = ::Karafka::Web.config.topics.errors
24
25
 
25
26
  if existing_topics_names.include?(errors_topic)
@@ -88,6 +89,26 @@ module Karafka
88
89
  created(consumers_metrics_topic)
89
90
  end
90
91
 
92
+ if existing_topics_names.include?(consumers_commands_topic)
93
+ exists(consumers_commands_topic)
94
+ else
95
+ creating(consumers_commands_topic)
96
+ # Commands are suppose to live short and be used for controlling processes and some
97
+ # debug. Their data can be removed safely fast.
98
+ ::Karafka::Admin.create_topic(
99
+ consumers_commands_topic,
100
+ 1,
101
+ replication_factor,
102
+ {
103
+ 'cleanup.policy': 'delete',
104
+ 'retention.ms': 7 * 24 * 60 * 60 * 1_000, # 7 days
105
+ 'segment.ms': 12 * 60 * 60 * 1_000, # 24h
106
+ 'segment.bytes': 104_857_600 # 100MB
107
+ }
108
+ )
109
+ created(consumers_commands_topic)
110
+ end
111
+
91
112
  # Create only if needed
92
113
  if existing_topics_names.include?(consumers_states_topic)
93
114
  exists(consumers_states_topic)
@@ -12,6 +12,7 @@ module Karafka
12
12
  ::Karafka::Web.config.topics.consumers.states,
13
13
  ::Karafka::Web.config.topics.consumers.reports,
14
14
  ::Karafka::Web.config.topics.consumers.metrics,
15
+ ::Karafka::Web.config.topics.consumers.commands,
15
16
  ::Karafka::Web.config.topics.errors
16
17
  ].each do |topic_name|
17
18
  if existing_topics_names.include?(topic_name.to_s)
@@ -37,7 +37,7 @@ module Karafka
37
37
  # Enables all the needed routes
38
38
  def extend_routing
39
39
  ::Karafka::App.routes.draw do
40
- web_deserializer = ::Karafka::Web::Deserializer.new
40
+ payload_deserializer = ::Karafka::Web::Deserializer.new
41
41
 
42
42
  consumer_group ::Karafka::Web.config.processing.consumer_group do
43
43
  # Topic we listen on to materialize the states
@@ -52,7 +52,7 @@ module Karafka
52
52
  # This needs to be true in order not to reload the consumer in dev. This consumer
53
53
  # should not be affected by the end user development process
54
54
  consumer_persistence true
55
- deserializer web_deserializer
55
+ deserializers(payload: payload_deserializer)
56
56
  manual_offset_management true
57
57
  # Start from the most recent data, do not materialize historical states
58
58
  # This prevents us from dealing with cases, where client id would be changed and
@@ -66,19 +66,25 @@ module Karafka
66
66
  topic ::Karafka::Web.config.topics.consumers.states do
67
67
  config(active: false)
68
68
  active false
69
- deserializer web_deserializer
69
+ deserializers(payload: payload_deserializer)
70
70
  end
71
71
 
72
72
  topic ::Karafka::Web.config.topics.consumers.metrics do
73
73
  config(active: false)
74
74
  active false
75
- deserializer web_deserializer
75
+ deserializers(payload: payload_deserializer)
76
+ end
77
+
78
+ topic ::Karafka::Web.config.topics.consumers.commands do
79
+ config(active: false)
80
+ active false
81
+ deserializers(payload: payload_deserializer)
76
82
  end
77
83
 
78
84
  topic ::Karafka::Web.config.topics.errors do
79
85
  config(active: false)
80
86
  active false
81
- deserializer web_deserializer
87
+ deserializers(payload: payload_deserializer)
82
88
  end
83
89
  end
84
90
  end
@@ -47,7 +47,7 @@ module Karafka
47
47
  def sorted_descendants
48
48
  ObjectSpace
49
49
  .each_object(Class)
50
- .select { |klass| klass < self }
50
+ .select { |klass| klass != self && klass.ancestors.include?(self) }
51
51
  .sort_by(&:index)
52
52
  end
53
53
  end
@@ -0,0 +1,33 @@
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 Pro
17
+ module Commanding
18
+ # Namespace for commands the process can react to
19
+ module Commands
20
+ # Base for all the commands
21
+ class Base
22
+ private
23
+
24
+ # @return [String] current process id
25
+ def process_id
26
+ @process_id ||= ::Karafka::Web.config.tracking.consumers.sampler.process_id
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end