karafka-web 0.9.1 → 0.10.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/ci.yml +30 -0
- data/.gitignore +2 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +85 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +30 -25
- data/LICENSE +1 -1
- data/bin/build_assets +51 -0
- data/bin/release +6 -0
- data/config/locales/pro_errors.yml +18 -0
- data/docker-compose.yml +1 -1
- data/gulpfile.js +73 -0
- data/karafka-web.gemspec +2 -2
- data/lib/karafka/web/config.rb +9 -10
- data/lib/karafka/web/contracts/base.rb +2 -0
- data/lib/karafka/web/contracts/config.rb +2 -1
- data/lib/karafka/web/errors.rb +12 -0
- data/lib/karafka/web/inflector.rb +1 -1
- data/lib/karafka/web/management/actions/enable.rb +11 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/0_set_initial.rb +39 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1699543515_fill_missing_received_and_sent_bytes.rb +28 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1700234522_introduce_waiting.rb +26 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1700234522_remove_processing.rb +26 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1704722380_split_listeners_into_active_and_paused.rb +38 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1706607960_introduce_lag_total.rb +40 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1706611396_rename_lag_total_to_lag_hybrid.rb +38 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1716218393_populate_jobs_metrics.rb +26 -0
- data/lib/karafka/web/management/migrations/consumers_states/0_set_initial.rb +46 -0
- data/lib/karafka/web/management/migrations/consumers_states/1699543515_fill_missing_received_and_sent_bytes.rb +25 -0
- data/lib/karafka/web/management/migrations/consumers_states/1700234522_introduce_waiting.rb +22 -0
- data/lib/karafka/web/management/migrations/consumers_states/1700234522_remove_processing.rb +22 -0
- data/lib/karafka/web/management/migrations/consumers_states/1704722380_split_listeners_into_active_and_paused.rb +34 -0
- data/lib/karafka/web/management/migrations/consumers_states/1706607960_introduce_lag_total.rb +24 -0
- data/lib/karafka/web/management/migrations/consumers_states/1706611396_rename_lag_total_to_lag_hybrid.rb +23 -0
- data/lib/karafka/web/management/migrations/consumers_states/1716218393_add_jobs_counter.rb +24 -0
- data/lib/karafka/web/management/migrator.rb +5 -5
- data/lib/karafka/web/pro/commanding/commands/base.rb +8 -0
- data/lib/karafka/web/pro/commanding/commands/quiet.rb +4 -1
- data/lib/karafka/web/pro/commanding/commands/stop.rb +4 -1
- data/lib/karafka/web/pro/loader.rb +8 -0
- data/lib/karafka/web/pro/ui/app.rb +44 -7
- data/lib/karafka/web/pro/ui/controllers/dlq_controller.rb +1 -1
- data/lib/karafka/web/pro/ui/controllers/errors_controller.rb +1 -0
- data/lib/karafka/web/pro/ui/controllers/explorer_controller.rb +6 -14
- data/lib/karafka/web/pro/ui/controllers/messages_controller.rb +5 -4
- data/lib/karafka/web/pro/ui/controllers/search_controller.rb +73 -0
- data/lib/karafka/web/pro/ui/controllers/support_controller.rb +26 -0
- data/lib/karafka/web/pro/ui/controllers/topics_controller.rb +31 -0
- data/lib/karafka/web/pro/ui/controllers/ux_controller.rb +26 -0
- data/lib/karafka/web/pro/ui/lib/policies/config.rb +39 -0
- data/lib/karafka/web/pro/ui/lib/policies/contracts/config.rb +46 -0
- data/lib/karafka/web/pro/ui/lib/policies/messages.rb +76 -0
- data/lib/karafka/web/pro/ui/lib/policies/requests.rb +36 -0
- data/lib/karafka/web/pro/ui/lib/policies.rb +34 -0
- data/lib/karafka/web/pro/ui/lib/safe_runner.rb +98 -0
- data/lib/karafka/web/pro/ui/lib/search/config.rb +53 -0
- data/lib/karafka/web/pro/ui/lib/search/contracts/config.rb +101 -0
- data/lib/karafka/web/pro/ui/lib/search/contracts/form.rb +111 -0
- data/lib/karafka/web/pro/ui/lib/search/matchers/base.rb +59 -0
- data/lib/karafka/web/pro/ui/lib/search/matchers/raw_header_includes.rb +57 -0
- data/lib/karafka/web/pro/ui/lib/search/matchers/raw_key_includes.rb +41 -0
- data/lib/karafka/web/pro/ui/lib/search/matchers/raw_payload_includes.rb +45 -0
- data/lib/karafka/web/pro/ui/lib/search/normalizer.rb +47 -0
- data/lib/karafka/web/pro/ui/lib/search/runner.rb +230 -0
- data/lib/karafka/web/pro/ui/lib/search.rb +36 -0
- data/lib/karafka/web/pro/ui/views/cluster/_breadcrumbs.erb +4 -4
- data/lib/karafka/web/pro/ui/views/cluster/_tabs.erb +14 -24
- data/lib/karafka/web/pro/ui/views/cluster/index.erb +20 -22
- data/lib/karafka/web/pro/ui/views/cluster/show.erb +21 -25
- data/lib/karafka/web/pro/ui/views/commands/_backtrace.erb +4 -19
- data/lib/karafka/web/pro/ui/views/commands/_breadcrumbs.erb +3 -3
- data/lib/karafka/web/pro/ui/views/commands/_command.erb +6 -6
- data/lib/karafka/web/pro/ui/views/commands/_command_details.erb +1 -11
- data/lib/karafka/web/pro/ui/views/commands/_incompatible_schema.erb +3 -14
- data/lib/karafka/web/pro/ui/views/commands/_metadata.erb +33 -42
- data/lib/karafka/web/pro/ui/views/commands/_table.erb +9 -3
- data/lib/karafka/web/pro/ui/views/commands/index.erb +18 -12
- data/lib/karafka/web/pro/ui/views/commands/show.erb +24 -29
- data/lib/karafka/web/pro/ui/views/consumers/_breadcrumbs.erb +8 -8
- data/lib/karafka/web/pro/ui/views/consumers/_consumer.erb +13 -23
- data/lib/karafka/web/pro/ui/views/consumers/_consumer_controls.erb +51 -35
- data/lib/karafka/web/pro/ui/views/consumers/_consumer_performance.erb +1 -1
- data/lib/karafka/web/pro/ui/views/consumers/_tabs.erb +28 -30
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_commands.erb +68 -28
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_job.erb +1 -1
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_metrics.erb +114 -133
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_partition.erb +4 -4
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_stopped.erb +6 -9
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_subscription_group.erb +116 -126
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_tabs.erb +26 -31
- data/lib/karafka/web/pro/ui/views/consumers/controls.erb +53 -57
- data/lib/karafka/web/pro/ui/views/consumers/details.erb +4 -17
- data/lib/karafka/web/pro/ui/views/consumers/index.erb +31 -34
- data/lib/karafka/web/pro/ui/views/consumers/pending_jobs.erb +41 -46
- data/lib/karafka/web/pro/ui/views/consumers/performance.erb +43 -47
- data/lib/karafka/web/pro/ui/views/consumers/running_jobs.erb +41 -46
- data/lib/karafka/web/pro/ui/views/consumers/subscriptions.erb +14 -17
- data/lib/karafka/web/pro/ui/views/dashboard/index.erb +67 -76
- data/lib/karafka/web/pro/ui/views/dlq/_breadcrumbs.erb +1 -1
- data/lib/karafka/web/pro/ui/views/dlq/_no_topics.erb +1 -7
- data/lib/karafka/web/pro/ui/views/dlq/_topic.erb +7 -10
- data/lib/karafka/web/pro/ui/views/dlq/index.erb +8 -10
- data/lib/karafka/web/pro/ui/views/errors/_breadcrumbs.erb +3 -3
- data/lib/karafka/web/pro/ui/views/errors/_error.erb +8 -5
- data/lib/karafka/web/pro/ui/views/errors/_selector.erb +12 -0
- data/lib/karafka/web/pro/ui/views/errors/_table.erb +5 -4
- data/lib/karafka/web/pro/ui/views/errors/index.erb +50 -15
- data/lib/karafka/web/pro/ui/views/errors/partition.erb +61 -14
- data/lib/karafka/web/pro/ui/views/errors/show.erb +28 -46
- data/lib/karafka/web/pro/ui/views/explorer/_breadcrumbs.erb +11 -3
- data/lib/karafka/web/pro/ui/views/explorer/_failed_deserialization.erb +8 -3
- data/lib/karafka/web/pro/ui/views/explorer/_message.erb +12 -6
- data/lib/karafka/web/pro/ui/views/explorer/_no_topics.erb +1 -5
- data/lib/karafka/web/pro/ui/views/explorer/_selector.erb +12 -0
- data/lib/karafka/web/pro/ui/views/explorer/_topic.erb +6 -8
- data/lib/karafka/web/pro/ui/views/explorer/index.erb +13 -15
- data/lib/karafka/web/pro/ui/views/explorer/message/_metadata.erb +68 -32
- data/lib/karafka/web/pro/ui/views/explorer/message/_payload.erb +17 -16
- data/lib/karafka/web/pro/ui/views/explorer/message/_resources_utilization.erb +127 -0
- data/lib/karafka/web/pro/ui/views/explorer/message/_too_big_to_be_displayed.erb +20 -0
- data/lib/karafka/web/pro/ui/views/explorer/messages/_detail.erb +1 -1
- data/lib/karafka/web/pro/ui/views/explorer/partition/_cleaned.erb +3 -5
- data/lib/karafka/web/pro/ui/views/explorer/partition/_empty.erb +3 -5
- data/lib/karafka/web/pro/ui/views/explorer/partition/_messages.erb +6 -3
- data/lib/karafka/web/pro/ui/views/explorer/partition.erb +67 -46
- data/lib/karafka/web/pro/ui/views/explorer/show.erb +85 -21
- data/lib/karafka/web/pro/ui/views/explorer/topic/_actions.erb +27 -0
- data/lib/karafka/web/pro/ui/views/explorer/topic/_empty.erb +3 -5
- data/lib/karafka/web/pro/ui/views/explorer/topic/_limited.erb +8 -10
- data/lib/karafka/web/pro/ui/views/explorer/topic.erb +24 -44
- data/lib/karafka/web/pro/ui/views/health/_breadcrumbs.erb +7 -7
- data/lib/karafka/web/pro/ui/views/health/_no_data.erb +1 -7
- data/lib/karafka/web/pro/ui/views/health/_partition.erb +3 -3
- data/lib/karafka/web/pro/ui/views/health/_partition_lags.erb +3 -3
- data/lib/karafka/web/pro/ui/views/health/_partition_offset.erb +2 -2
- data/lib/karafka/web/pro/ui/views/health/_partition_times.erb +3 -7
- data/lib/karafka/web/pro/ui/views/health/_table_metadata.erb +8 -0
- data/lib/karafka/web/pro/ui/views/health/_tabs.erb +32 -49
- data/lib/karafka/web/pro/ui/views/health/changes.erb +51 -51
- data/lib/karafka/web/pro/ui/views/health/cluster_lags.erb +28 -41
- data/lib/karafka/web/pro/ui/views/health/lags.erb +52 -52
- data/lib/karafka/web/pro/ui/views/health/offsets.erb +55 -55
- data/lib/karafka/web/pro/ui/views/health/overview.erb +60 -60
- data/lib/karafka/web/pro/ui/views/jobs/_job.erb +1 -1
- data/lib/karafka/web/pro/ui/views/jobs/_no_jobs.erb +1 -7
- data/lib/karafka/web/pro/ui/views/jobs/pending.erb +36 -38
- data/lib/karafka/web/pro/ui/views/jobs/running.erb +36 -38
- data/lib/karafka/web/pro/ui/views/routing/_consumer_group.erb +7 -12
- data/lib/karafka/web/pro/ui/views/routing/_topic.erb +13 -11
- data/lib/karafka/web/pro/ui/views/routing/index.erb +7 -9
- data/lib/karafka/web/pro/ui/views/routing/show.erb +41 -33
- data/lib/karafka/web/pro/ui/views/search/_fix_errors.erb +3 -0
- data/lib/karafka/web/pro/ui/views/search/_metadata.erb +71 -0
- data/lib/karafka/web/pro/ui/views/search/_no_results.erb +3 -0
- data/lib/karafka/web/pro/ui/views/search/_no_search_criteria.erb +5 -0
- data/lib/karafka/web/pro/ui/views/search/_search_criteria.erb +37 -0
- data/lib/karafka/web/pro/ui/views/search/_search_modal.erb +139 -0
- data/lib/karafka/web/pro/ui/views/search/_timeout.erb +3 -0
- data/lib/karafka/web/pro/ui/views/search/index.erb +29 -0
- data/lib/karafka/web/pro/ui/views/shared/_navigation.erb +80 -28
- data/lib/karafka/web/pro/ui/views/topics/_breadcrumbs.erb +14 -6
- data/lib/karafka/web/pro/ui/views/topics/_partition_offsets.erb +10 -0
- data/lib/karafka/web/pro/ui/views/topics/_tabs.erb +26 -32
- data/lib/karafka/web/pro/ui/views/topics/_topic.erb +7 -10
- data/lib/karafka/web/pro/ui/views/topics/config.erb +21 -25
- data/lib/karafka/web/pro/ui/views/topics/distribution/_badges.erb +10 -5
- data/lib/karafka/web/pro/ui/views/topics/distribution/_chart.erb +3 -1
- data/lib/karafka/web/pro/ui/views/topics/distribution/_limited.erb +1 -1
- data/lib/karafka/web/pro/ui/views/topics/distribution.erb +34 -39
- data/lib/karafka/web/pro/ui/views/topics/index.erb +13 -15
- data/lib/karafka/web/pro/ui/views/topics/offsets.erb +24 -0
- data/lib/karafka/web/pro/ui/views/topics/replication.erb +20 -24
- data/lib/karafka/web/processing/consumers/aggregators/metrics.rb +1 -1
- data/lib/karafka/web/processing/consumers/aggregators/state.rb +1 -1
- data/lib/karafka/web/processing/consumers/contracts/aggregated_stats.rb +1 -0
- data/lib/karafka/web/tracking/consumers/contracts/report.rb +6 -0
- data/lib/karafka/web/tracking/consumers/listeners/connections.rb +8 -6
- data/lib/karafka/web/tracking/consumers/listeners/processing.rb +2 -0
- data/lib/karafka/web/tracking/consumers/listeners/tags.rb +1 -1
- data/lib/karafka/web/tracking/consumers/reporter.rb +6 -8
- data/lib/karafka/web/tracking/consumers/sampler.rb +16 -5
- data/lib/karafka/web/ui/app.rb +20 -1
- data/lib/karafka/web/ui/base.rb +26 -20
- data/lib/karafka/web/ui/controllers/base_controller.rb +7 -5
- data/lib/karafka/web/ui/controllers/dashboard_controller.rb +8 -0
- data/lib/karafka/web/ui/controllers/requests/params.rb +16 -2
- data/lib/karafka/web/ui/controllers/support_controller.rb +17 -0
- data/lib/karafka/web/ui/controllers/ux_controller.rb +17 -0
- data/lib/karafka/web/ui/helpers/application_helper.rb +75 -42
- data/lib/karafka/web/ui/helpers/paths_helper.rb +24 -0
- data/lib/karafka/web/ui/helpers/tailwind_helper.rb +90 -0
- data/lib/karafka/web/ui/lib/sorter.rb +1 -1
- data/lib/karafka/web/ui/models/metrics/aggregated.rb +1 -0
- data/lib/karafka/web/ui/models/metrics/charts/topics.rb +36 -20
- data/lib/karafka/web/ui/models/status.rb +28 -1
- data/lib/karafka/web/ui/public/images/calendar.svg +3 -0
- data/lib/karafka/web/ui/public/javascripts/application.js +39 -15
- data/lib/karafka/web/ui/public/javascripts/application.min.js +64 -0
- data/lib/karafka/web/ui/public/javascripts/application.min.js.br +0 -0
- data/lib/karafka/web/ui/public/javascripts/application.min.js.gz +0 -0
- data/lib/karafka/web/ui/public/javascripts/charts/types/line.js +41 -9
- data/lib/karafka/web/ui/public/javascripts/components/btn_toggle_manager.js +37 -0
- data/lib/karafka/web/ui/public/javascripts/{live_poll.js → components/live_poll.js} +44 -8
- data/lib/karafka/web/ui/public/javascripts/{offset_datetime.js → components/offset_datetime.js} +1 -1
- data/lib/karafka/web/ui/public/javascripts/components/search.js +102 -0
- data/lib/karafka/web/ui/public/javascripts/components/tabs_manager.js +84 -0
- data/lib/karafka/web/ui/public/javascripts/components/theme_manager.js +59 -0
- data/lib/karafka/web/ui/public/javascripts/components/turbo_tracker.js +30 -0
- data/lib/karafka/web/ui/public/javascripts/libs/datepicker.js +2 -2
- data/lib/karafka/web/ui/public/javascripts/libs/turbo.js +6618 -0
- data/lib/karafka/web/ui/public/stylesheets/application.css +16 -113
- data/lib/karafka/web/ui/public/stylesheets/application.min.css +13 -0
- data/lib/karafka/web/ui/public/stylesheets/application.min.css.br +0 -0
- data/lib/karafka/web/ui/public/stylesheets/application.min.css.gz +0 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/highlight_dark.min.css +8 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/highlight_dark.min.css.br +0 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/highlight_dark.min.css.gz +0 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/highlight_light.min.css.br +0 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/highlight_light.min.css.gz +0 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/tailwind.css +391 -0
- data/lib/karafka/web/ui/views/cluster/_breadcrumbs.erb +3 -3
- data/lib/karafka/web/ui/views/cluster/_tabs.erb +14 -24
- data/lib/karafka/web/ui/views/cluster/brokers.erb +20 -22
- data/lib/karafka/web/ui/views/cluster/replication.erb +28 -32
- data/lib/karafka/web/ui/views/consumers/_assignments_badges.erb +1 -1
- data/lib/karafka/web/ui/views/consumers/_breadcrumbs.erb +5 -0
- data/lib/karafka/web/ui/views/consumers/_consumer.erb +9 -13
- data/lib/karafka/web/ui/views/consumers/_no_consumers.erb +2 -8
- data/lib/karafka/web/ui/views/consumers/_summary.erb +34 -45
- data/lib/karafka/web/ui/views/consumers/_tabs.erb +35 -0
- data/lib/karafka/web/ui/views/consumers/index.erb +31 -33
- data/lib/karafka/web/ui/views/dashboard/_counters.erb +76 -0
- data/lib/karafka/web/ui/views/dashboard/_feature_pro.erb +6 -2
- data/lib/karafka/web/ui/views/dashboard/_not_enough_data.erb +3 -15
- data/lib/karafka/web/ui/views/dashboard/_ranges_selector.erb +12 -12
- data/lib/karafka/web/ui/views/dashboard/index.erb +78 -52
- data/lib/karafka/web/ui/views/errors/_breadcrumbs.erb +2 -2
- data/lib/karafka/web/ui/views/errors/_detail.erb +1 -3
- data/lib/karafka/web/ui/views/errors/_error.erb +3 -5
- data/lib/karafka/web/ui/views/errors/index.erb +34 -44
- data/lib/karafka/web/ui/views/errors/show.erb +29 -47
- data/lib/karafka/web/ui/views/jobs/_breadcrumbs.erb +3 -3
- data/lib/karafka/web/ui/views/jobs/_job.erb +1 -1
- data/lib/karafka/web/ui/views/jobs/_no_jobs.erb +1 -7
- data/lib/karafka/web/ui/views/jobs/_tabs.erb +14 -24
- data/lib/karafka/web/ui/views/jobs/pending.erb +30 -32
- data/lib/karafka/web/ui/views/jobs/running.erb +30 -32
- data/lib/karafka/web/ui/views/layout.erb +37 -21
- data/lib/karafka/web/ui/views/routing/_breadcrumbs.erb +2 -2
- data/lib/karafka/web/ui/views/routing/_consumer_group.erb +7 -12
- data/lib/karafka/web/ui/views/routing/_topic.erb +3 -5
- data/lib/karafka/web/ui/views/routing/index.erb +7 -9
- data/lib/karafka/web/ui/views/routing/show.erb +30 -22
- data/lib/karafka/web/ui/views/shared/_become_pro.erb +8 -8
- data/lib/karafka/web/ui/views/shared/_brand.erb +2 -2
- data/lib/karafka/web/ui/views/shared/_breadcrumbs.erb +23 -0
- data/lib/karafka/web/ui/views/shared/_content.erb +2 -28
- data/lib/karafka/web/ui/views/shared/_controls.erb +15 -0
- data/lib/karafka/web/ui/views/shared/_flashes.erb +5 -7
- data/lib/karafka/web/ui/views/shared/_header.erb +14 -19
- data/lib/karafka/web/ui/views/shared/_navigation.erb +84 -28
- data/lib/karafka/web/ui/views/shared/_no_paginated_data.erb +5 -9
- data/lib/karafka/web/ui/views/shared/_pagination.erb +11 -11
- data/lib/karafka/web/ui/views/shared/_tab_nav.erb +4 -5
- data/lib/karafka/web/ui/views/shared/_title.erb +5 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_error.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_info.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_primary.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_secondary.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_success.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_warning.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_error.erb +4 -0
- data/lib/karafka/web/ui/views/shared/alerts/_info.erb +5 -2
- data/lib/karafka/web/ui/views/shared/alerts/_primary.erb +4 -0
- data/lib/karafka/web/ui/views/shared/alerts/_secondary.erb +4 -0
- data/lib/karafka/web/ui/views/shared/alerts/_success.erb +4 -0
- data/lib/karafka/web/ui/views/shared/alerts/_warning.erb +4 -0
- data/lib/karafka/web/ui/views/shared/charts/_line.erb +1 -1
- data/lib/karafka/web/ui/views/shared/exceptions/not_allowed.erb +14 -19
- data/lib/karafka/web/ui/views/shared/exceptions/not_found.erb +16 -21
- data/lib/karafka/web/ui/views/shared/exceptions/pro_only.erb +16 -28
- data/lib/karafka/web/ui/views/shared/icons/_arrow_down_on_square.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_arrow_down_tray.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_arrow_on_squares.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_arrow_path_rounded.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_arrow_uturn_right.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_arrows_right_left.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_blocks.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_book_open.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_bug.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_burger.erb +14 -0
- data/lib/karafka/web/ui/views/shared/icons/_calendar_days.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_chart_bar.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_check_badge.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_check_circle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_circle_stack.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_cpu.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_document_glass.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_exclamation_triangle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_eye.erb +4 -0
- data/lib/karafka/web/ui/views/shared/icons/_gear.erb +4 -0
- data/lib/karafka/web/ui/views/shared/icons/_github.erb +13 -0
- data/lib/karafka/web/ui/views/shared/icons/_globe.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_heart.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_home.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_info_circle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_lifebuoy.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_light_bulb.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_list_bullets.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_magnifying_glass.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_moon.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_offices.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_pause.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_pause_circle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_play_circle.erb +4 -0
- data/lib/karafka/web/ui/views/shared/icons/_question_circle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_queue_list.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_refresh.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_slack.erb +16 -0
- data/lib/karafka/web/ui/views/shared/icons/_stop.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_sun.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_x_circle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_x_mark.erb +3 -0
- data/lib/karafka/web/ui/views/status/_breadcrumbs.erb +1 -1
- data/lib/karafka/web/ui/views/status/_failure.erb +2 -13
- data/lib/karafka/web/ui/views/status/_halted.erb +2 -10
- data/lib/karafka/web/ui/views/status/_info.erb +2 -13
- data/lib/karafka/web/ui/views/status/_success.erb +2 -10
- data/lib/karafka/web/ui/views/status/_warning.erb +2 -13
- data/lib/karafka/web/ui/views/status/failures/_connection.erb +2 -2
- data/lib/karafka/web/ui/views/status/failures/_consumers_reports.erb +3 -3
- data/lib/karafka/web/ui/views/status/failures/_consumers_reports_schema_state.erb +4 -4
- data/lib/karafka/web/ui/views/status/failures/_enabled.erb +2 -2
- data/lib/karafka/web/ui/views/status/failures/_initial_consumers_metrics.erb +6 -6
- data/lib/karafka/web/ui/views/status/failures/_initial_consumers_state.erb +6 -6
- data/lib/karafka/web/ui/views/status/failures/_live_reporting.erb +2 -2
- data/lib/karafka/web/ui/views/status/failures/_materializing_lag.erb +11 -0
- data/lib/karafka/web/ui/views/status/failures/_partitions.erb +3 -3
- data/lib/karafka/web/ui/views/status/failures/_state_calculation.erb +2 -2
- data/lib/karafka/web/ui/views/status/failures/_topics.erb +3 -3
- data/lib/karafka/web/ui/views/status/info/_components.erb +14 -41
- data/lib/karafka/web/ui/views/status/show.erb +165 -154
- data/lib/karafka/web/ui/views/status/warnings/_connection.erb +3 -3
- data/lib/karafka/web/ui/views/status/warnings/_pro_subscription.erb +2 -2
- data/lib/karafka/web/ui/views/status/warnings/_replication.erb +2 -2
- data/lib/karafka/web/ui/views/status/warnings/_routing_topics_presence.erb +1 -1
- data/lib/karafka/web/ui/views/support/_breadcrumbs.erb +5 -0
- data/lib/karafka/web/ui/views/support/show.erb +71 -0
- data/lib/karafka/web/ui/views/ux/_alerts.erb +25 -0
- data/lib/karafka/web/ui/views/ux/_badges.erb +21 -0
- data/lib/karafka/web/ui/views/ux/_breadcrumbs.erb +5 -0
- data/lib/karafka/web/ui/views/ux/_buttons.erb +47 -0
- data/lib/karafka/web/ui/views/ux/_card_detail.erb +15 -0
- data/lib/karafka/web/ui/views/ux/_card_metric.erb +123 -0
- data/lib/karafka/web/ui/views/ux/_card_summary.erb +72 -0
- data/lib/karafka/web/ui/views/ux/_card_support.erb +39 -0
- data/lib/karafka/web/ui/views/ux/_code.erb +9 -0
- data/lib/karafka/web/ui/views/ux/_data_table.erb +52 -0
- data/lib/karafka/web/ui/views/ux/_headers.erb +2 -0
- data/lib/karafka/web/ui/views/ux/_icons.erb +9 -0
- data/lib/karafka/web/ui/views/ux/_pagination.erb +32 -0
- data/lib/karafka/web/ui/views/ux/_row_table.erb +52 -0
- data/lib/karafka/web/ui/views/ux/_status_rows.erb +53 -0
- data/lib/karafka/web/ui/views/ux/_tabs.erb +14 -0
- data/lib/karafka/web/ui/views/ux/_text.erb +2 -0
- data/lib/karafka/web/ui/views/ux/_topic_tiles.erb +42 -0
- data/lib/karafka/web/ui/views/ux/show.erb +19 -0
- data/lib/karafka/web/version.rb +1 -1
- data/lib/karafka/web.rb +2 -0
- data/package-lock.json +4158 -0
- data/package.json +15 -0
- data/postcss.config.js +6 -0
- data/tailwind.config.js +16 -0
- data.tar.gz.sig +0 -0
- metadata +172 -47
- metadata.gz.sig +0 -0
- data/lib/karafka/web/management/migrations/0_set_initial_consumers_metrics.rb +0 -36
- data/lib/karafka/web/management/migrations/0_set_initial_consumers_state.rb +0 -43
- data/lib/karafka/web/management/migrations/1699543515_fill_missing_received_and_sent_bytes_in_consumers_metrics.rb +0 -26
- data/lib/karafka/web/management/migrations/1699543515_fill_missing_received_and_sent_bytes_in_consumers_state.rb +0 -23
- data/lib/karafka/web/management/migrations/1700234522_introduce_waiting_in_consumers_metrics.rb +0 -24
- data/lib/karafka/web/management/migrations/1700234522_introduce_waiting_in_consumers_state.rb +0 -20
- data/lib/karafka/web/management/migrations/1700234522_remove_processing_from_consumers_metrics.rb +0 -24
- data/lib/karafka/web/management/migrations/1700234522_remove_processing_from_consumers_state.rb +0 -20
- data/lib/karafka/web/management/migrations/1704722380_split_listeners_into_active_and_paused_in_metrics.rb +0 -36
- data/lib/karafka/web/management/migrations/1704722380_split_listeners_into_active_and_paused_in_states.rb +0 -32
- data/lib/karafka/web/management/migrations/1706607960_introduce_lag_total_in_metrics.rb +0 -38
- data/lib/karafka/web/management/migrations/1706607960_introduce_lag_total_in_states.rb +0 -22
- data/lib/karafka/web/management/migrations/1706611396_rename_lag_total_to_lag_hybrid_in_metrics.rb +0 -36
- data/lib/karafka/web/management/migrations/1706611396_rename_lag_total_to_lag_hybrid_in_states.rb +0 -21
- data/lib/karafka/web/pro/ui/views/cluster/brokers.erb +0 -27
- data/lib/karafka/web/pro/ui/views/commands/_details.erb +0 -26
- data/lib/karafka/web/pro/ui/views/consumers/_counters.erb +0 -72
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_title.erb +0 -5
- data/lib/karafka/web/pro/ui/views/errors/_title_with_select.erb +0 -31
- data/lib/karafka/web/pro/ui/views/explorer/message/_message_actions.erb +0 -18
- data/lib/karafka/web/pro/ui/views/explorer/message/_payload_actions.erb +0 -19
- data/lib/karafka/web/pro/ui/views/explorer/partition/_details.erb +0 -35
- data/lib/karafka/web/pro/ui/views/explorer/topic/_details.erb +0 -23
- data/lib/karafka/web/pro/ui/views/health/_consumer_group_header.erb +0 -14
- data/lib/karafka/web/ui/controllers/responses/deny.rb +0 -15
- data/lib/karafka/web/ui/helpers/alerts_helper.rb +0 -23
- data/lib/karafka/web/ui/lib/safe_runner.rb +0 -59
- data/lib/karafka/web/ui/models/visibility_filter.rb +0 -49
- data/lib/karafka/web/ui/public/javascripts/libs/bootstrap.min.js +0 -6
- data/lib/karafka/web/ui/public/javascripts/tabs_manager.js +0 -57
- data/lib/karafka/web/ui/public/stylesheets/libs/bootstrap.min.css +0 -6
- data/lib/karafka/web/ui/views/consumers/_counters.erb +0 -62
- data/lib/karafka/web/ui/views/errors/_watermark_offsets.erb +0 -10
- data/lib/karafka/web/ui/views/shared/_feature_pro.erb +0 -4
- data/lib/karafka/web/ui/views/shared/_footer.erb +0 -22
- data/lib/karafka/web/ui/views/shared/_live_poll.erb +0 -7
- /data/lib/karafka/web/management/migrations/{0_base.rb → base.rb} +0 -0
- /data/lib/karafka/web/ui/public/javascripts/{charts.js → components/charts.js} +0 -0
- /data/lib/karafka/web/ui/public/stylesheets/libs/{highlight.min.css → highlight_light.min.css} +0 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Karafka
|
4
|
+
module Web
|
5
|
+
module Management
|
6
|
+
module Migrations
|
7
|
+
module ConsumersMetrics
|
8
|
+
# Adds bytes_sent and bytes_received to all the aggregated metrics samples, so we have
|
9
|
+
# charts that do not have to fill gaps or check anything
|
10
|
+
class FillMissingReceivedAndSentBytes < Base
|
11
|
+
self.versions_until = '1.1.0'
|
12
|
+
self.type = :consumers_metrics
|
13
|
+
|
14
|
+
# @param state [Hash] metrics state
|
15
|
+
def migrate(state)
|
16
|
+
state[:aggregated].each_value do |metrics|
|
17
|
+
metrics.each do |metric|
|
18
|
+
metric.last[:bytes_sent] = 0
|
19
|
+
metric.last[:bytes_received] = 0
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Karafka
|
4
|
+
module Web
|
5
|
+
module Management
|
6
|
+
module Migrations
|
7
|
+
module ConsumersMetrics
|
8
|
+
# Introduce waiting in consumers metrics to complement busy and enqueued for jobs metrics
|
9
|
+
class IntroduceWaiting < Base
|
10
|
+
self.versions_until = '1.1.1'
|
11
|
+
self.type = :consumers_metrics
|
12
|
+
|
13
|
+
# @param state [Hash]
|
14
|
+
def migrate(state)
|
15
|
+
state[:aggregated].each_value do |metrics|
|
16
|
+
metrics.each do |metric|
|
17
|
+
metric.last[:waiting] = 0
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Karafka
|
4
|
+
module Web
|
5
|
+
module Management
|
6
|
+
module Migrations
|
7
|
+
module ConsumersMetrics
|
8
|
+
# Moves unused "processing" that was used instead of "busy" in older versions
|
9
|
+
class RemoveProcessing < Base
|
10
|
+
self.versions_until = '1.1.1'
|
11
|
+
self.type = :consumers_metrics
|
12
|
+
|
13
|
+
# @param state [Hash]
|
14
|
+
def migrate(state)
|
15
|
+
state[:aggregated].each_value do |metrics|
|
16
|
+
metrics.each do |metric|
|
17
|
+
metric.last.delete(:processing)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Karafka
|
4
|
+
module Web
|
5
|
+
module Management
|
6
|
+
module Migrations
|
7
|
+
module ConsumersMetrics
|
8
|
+
# Since we have introduced notion of pause listeners, we need to reflect this in the
|
9
|
+
# UI, so the scaling changes are visible
|
10
|
+
class SplitListenersIntoActiveAndPaused < Base
|
11
|
+
self.versions_until = '1.1.2'
|
12
|
+
self.type = :consumers_metrics
|
13
|
+
|
14
|
+
# @param state [Hash]
|
15
|
+
def migrate(state)
|
16
|
+
state[:aggregated].each_value do |metrics|
|
17
|
+
metrics.each do |metric|
|
18
|
+
listeners = if metric.last.key?(:listeners)
|
19
|
+
metric.last[:listeners].to_i
|
20
|
+
elsif metric.last.key?(:listeners_count)
|
21
|
+
metric.last[:listeners_count].to_i
|
22
|
+
else
|
23
|
+
0
|
24
|
+
end
|
25
|
+
|
26
|
+
metric.last[:listeners] = {
|
27
|
+
active: listeners,
|
28
|
+
standby: 0
|
29
|
+
}
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/karafka/web/management/migrations/consumers_metrics/1706607960_introduce_lag_total.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Karafka
|
4
|
+
module Web
|
5
|
+
module Management
|
6
|
+
module Migrations
|
7
|
+
module ConsumersMetrics
|
8
|
+
# Moves to using lag total as a normalization for both lags
|
9
|
+
class IntroduceLagTotal < Base
|
10
|
+
self.versions_until = '1.2.0'
|
11
|
+
self.type = :consumers_metrics
|
12
|
+
|
13
|
+
# @param state [Hash]
|
14
|
+
def migrate(state)
|
15
|
+
state[:aggregated].each_value do |metrics|
|
16
|
+
metrics.each do |metric|
|
17
|
+
metric.last[:lag_total] = metric.last[:lag_stored]
|
18
|
+
metric.last.delete(:lag_stored)
|
19
|
+
metric.last.delete(:lag)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
state[:consumer_groups].each_value do |metrics|
|
24
|
+
metrics.each do |metric_group|
|
25
|
+
metric_group.last.each_value do |metric|
|
26
|
+
metric.each_value do |sample|
|
27
|
+
sample[:lag_total] = sample[:lag_stored]
|
28
|
+
sample.delete(:lag_stored)
|
29
|
+
sample.delete(:lag)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Karafka
|
4
|
+
module Web
|
5
|
+
module Management
|
6
|
+
module Migrations
|
7
|
+
module ConsumersMetrics
|
8
|
+
# Renames total lag to hybrid to better represent what it is
|
9
|
+
class RenameLagTotalToLagHybrid < Base
|
10
|
+
self.versions_until = '1.2.1'
|
11
|
+
self.type = :consumers_metrics
|
12
|
+
|
13
|
+
# @param state [Hash]
|
14
|
+
def migrate(state)
|
15
|
+
state[:aggregated].each_value do |metrics|
|
16
|
+
metrics.each do |metric|
|
17
|
+
metric.last[:lag_hybrid] = metric.last[:lag_total] || 0
|
18
|
+
metric.last.delete(:lag_total)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
state[:consumer_groups].each_value do |metrics|
|
23
|
+
metrics.each do |metric_group|
|
24
|
+
metric_group.last.each_value do |metric|
|
25
|
+
metric.each_value do |sample|
|
26
|
+
sample[:lag_hybrid] = sample[:lag_total]
|
27
|
+
sample.delete(:lag_total)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/karafka/web/management/migrations/consumers_metrics/1716218393_populate_jobs_metrics.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Karafka
|
4
|
+
module Web
|
5
|
+
module Management
|
6
|
+
module Migrations
|
7
|
+
module ConsumersMetrics
|
8
|
+
# Adds the jobs metric matching batches for aggregated metrics results
|
9
|
+
class PopulateJobsMetrics < Base
|
10
|
+
self.versions_until = '1.3.0'
|
11
|
+
self.type = :consumers_metrics
|
12
|
+
|
13
|
+
# @param state [Hash]
|
14
|
+
def migrate(state)
|
15
|
+
state[:aggregated].each_value do |metrics|
|
16
|
+
metrics.each do |metric|
|
17
|
+
metric.last[:jobs] = metric.last[:batches] || 0
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Karafka
|
4
|
+
module Web
|
5
|
+
module Management
|
6
|
+
module Migrations
|
7
|
+
# Consumers states topic data related migrations
|
8
|
+
module ConsumersStates
|
9
|
+
# Initial migration that sets the consumers state initial first state.
|
10
|
+
# This is the basic of state as they were when they were introduced.
|
11
|
+
class SetInitial < Base
|
12
|
+
# Run this only on the first setup
|
13
|
+
self.versions_until = '0.0.1'
|
14
|
+
self.type = :consumers_states
|
15
|
+
|
16
|
+
# @param state [Hash]
|
17
|
+
def migrate(state)
|
18
|
+
state.merge!(
|
19
|
+
processes: {},
|
20
|
+
stats: {
|
21
|
+
batches: 0,
|
22
|
+
messages: 0,
|
23
|
+
retries: 0,
|
24
|
+
dead: 0,
|
25
|
+
busy: 0,
|
26
|
+
enqueued: 0,
|
27
|
+
processing: 0,
|
28
|
+
workers: 0,
|
29
|
+
processes: 0,
|
30
|
+
rss: 0,
|
31
|
+
listeners: 0,
|
32
|
+
utilization: 0,
|
33
|
+
errors: 0,
|
34
|
+
lag_stored: 0,
|
35
|
+
lag: 0
|
36
|
+
},
|
37
|
+
schema_state: 'accepted',
|
38
|
+
dispatched_at: float_now
|
39
|
+
)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Karafka
|
4
|
+
module Web
|
5
|
+
module Management
|
6
|
+
module Migrations
|
7
|
+
module ConsumersStates
|
8
|
+
# Similar to filling in consumers metrics, we initialize this with zeros so it is always
|
9
|
+
# present as expected
|
10
|
+
class FillMissingReceivedAndSentBytes < Base
|
11
|
+
# Network metrics were introduced with schema 1.2.0
|
12
|
+
self.versions_until = '1.2.0'
|
13
|
+
self.type = :consumers_states
|
14
|
+
|
15
|
+
# @param state [Hash]
|
16
|
+
def migrate(state)
|
17
|
+
state[:stats][:bytes_sent] = 0
|
18
|
+
state[:stats][:bytes_received] = 0
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Karafka
|
4
|
+
module Web
|
5
|
+
module Management
|
6
|
+
module Migrations
|
7
|
+
module ConsumersStates
|
8
|
+
# Introduce waiting in consumers metrics to complement busy and enqueued for jobs stats
|
9
|
+
class IntroduceWaiting < Base
|
10
|
+
self.versions_until = '1.2.1'
|
11
|
+
self.type = :consumers_states
|
12
|
+
|
13
|
+
# @param state [Hash]
|
14
|
+
def migrate(state)
|
15
|
+
state[:stats][:waiting] = 0
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Karafka
|
4
|
+
module Web
|
5
|
+
module Management
|
6
|
+
module Migrations
|
7
|
+
module ConsumersStates
|
8
|
+
# Moves unused "processing" that was used instead of "busy" in older versions
|
9
|
+
class RemoveProcessing < Base
|
10
|
+
self.versions_until = '1.2.1'
|
11
|
+
self.type = :consumers_states
|
12
|
+
|
13
|
+
# @param state [Hash]
|
14
|
+
def migrate(state)
|
15
|
+
state[:stats].delete(:processing)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Karafka
|
4
|
+
module Web
|
5
|
+
module Management
|
6
|
+
module Migrations
|
7
|
+
module ConsumersStates
|
8
|
+
# Since we have introduced notion of pause listeners, we need to reflect this in the
|
9
|
+
# UI, so the scaling changes are visible
|
10
|
+
class SplitListenersIntoActiveAndPaused < Base
|
11
|
+
self.versions_until = '1.2.2'
|
12
|
+
self.type = :consumers_states
|
13
|
+
|
14
|
+
# @param state [Hash]
|
15
|
+
def migrate(state)
|
16
|
+
listeners = if state[:stats].key?(:listeners)
|
17
|
+
state[:stats][:listeners].to_i
|
18
|
+
elsif state[:stats].key?(:listeners_count)
|
19
|
+
state[:stats][:listeners_count].to_i
|
20
|
+
else
|
21
|
+
0
|
22
|
+
end
|
23
|
+
|
24
|
+
state[:stats][:listeners] = {
|
25
|
+
active: listeners,
|
26
|
+
standby: 0
|
27
|
+
}
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Karafka
|
4
|
+
module Web
|
5
|
+
module Management
|
6
|
+
module Migrations
|
7
|
+
module ConsumersStates
|
8
|
+
# Moves to using lag total as a normalization for both lags
|
9
|
+
class IntroduceLagTotal < Base
|
10
|
+
self.versions_until = '1.3.0'
|
11
|
+
self.type = :consumers_states
|
12
|
+
|
13
|
+
# @param state [Hash]
|
14
|
+
def migrate(state)
|
15
|
+
state[:stats][:lag_total] = state[:stats][:lag_stored]
|
16
|
+
state[:stats].delete(:lag)
|
17
|
+
state[:stats].delete(:lag_stored)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Karafka
|
4
|
+
module Web
|
5
|
+
module Management
|
6
|
+
module Migrations
|
7
|
+
module ConsumersStates
|
8
|
+
# Renames total lag to hybrid to better represent what it is
|
9
|
+
class RenameLagTotalToLagHybrid < Base
|
10
|
+
self.versions_until = '1.3.1'
|
11
|
+
self.type = :consumers_states
|
12
|
+
|
13
|
+
# @param state [Hash]
|
14
|
+
def migrate(state)
|
15
|
+
state[:stats][:lag_hybrid] = state[:stats][:lag_total] || 0
|
16
|
+
state[:stats].delete(:lag_total)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Karafka
|
4
|
+
module Web
|
5
|
+
module Management
|
6
|
+
module Migrations
|
7
|
+
module ConsumersStates
|
8
|
+
# Adds the jobs counter matching batches
|
9
|
+
class AddJobsCounter < Base
|
10
|
+
self.versions_until = '1.4.0'
|
11
|
+
self.type = :consumers_states
|
12
|
+
|
13
|
+
# @param state [Hash]
|
14
|
+
def migrate(state)
|
15
|
+
# If missing we copy-paste from batches as the closest matching value.
|
16
|
+
# Since batch always has a job, this is a good starting point
|
17
|
+
state[:stats][:jobs] = state[:stats][:batches]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -52,7 +52,7 @@ module Karafka
|
|
52
52
|
# any states we manage. We can only move forward, so attempt to migrate for example from
|
53
53
|
# 1.0.0 to 0.9.0 should be considered and error.
|
54
54
|
def ensure_migrable!
|
55
|
-
if
|
55
|
+
if consumers_states[:schema_version] > State::SCHEMA_VERSION
|
56
56
|
raise(
|
57
57
|
Errors::Management::IncompatibleSchemaError,
|
58
58
|
'consumers state newer than supported'
|
@@ -90,21 +90,21 @@ module Karafka
|
|
90
90
|
|
91
91
|
# Publishes all the states migrated records
|
92
92
|
def publish
|
93
|
-
|
93
|
+
consumers_states[:schema_version] = State::SCHEMA_VERSION
|
94
94
|
consumers_metrics[:schema_version] = Metrics::SCHEMA_VERSION
|
95
95
|
|
96
96
|
# Migrator may run in the context of the processing consumer prior to any states
|
97
97
|
# fetching related to processing. We use sync to make sure, that the following
|
98
98
|
# processing related states fetched fetch the new states
|
99
99
|
Processing::Publisher.publish!(
|
100
|
-
|
100
|
+
consumers_states,
|
101
101
|
consumers_metrics
|
102
102
|
)
|
103
103
|
end
|
104
104
|
|
105
105
|
# @return [Hash] current consumers states most recent state
|
106
|
-
def
|
107
|
-
@
|
106
|
+
def consumers_states
|
107
|
+
@consumers_states ||= Processing::Consumers::State.current!
|
108
108
|
end
|
109
109
|
|
110
110
|
# @return [Hash] current consumers metrics most recent state
|
@@ -25,6 +25,14 @@ module Karafka
|
|
25
25
|
def process_id
|
26
26
|
@process_id ||= ::Karafka::Web.config.tracking.consumers.sampler.process_id
|
27
27
|
end
|
28
|
+
|
29
|
+
# @return [Boolean] Is given process to which a command was sent operating in an
|
30
|
+
# standalone mode. We need to know this, because some commands are prohibited from
|
31
|
+
# being executed in the embedded or swarm processes since there the signaling is
|
32
|
+
# handled differently (either via the main process or supervisor).
|
33
|
+
def standalone?
|
34
|
+
Karafka::Server.execution_mode == :standalone
|
35
|
+
end
|
28
36
|
end
|
29
37
|
end
|
30
38
|
end
|
@@ -18,9 +18,12 @@ module Karafka
|
|
18
18
|
# Namespace for commands the process can react to
|
19
19
|
module Commands
|
20
20
|
# Sends a signal to quiet the consumer
|
21
|
+
# @note Does not work in an embedded mode because we do not own the Ruby process.
|
21
22
|
class Quiet < Base
|
22
|
-
# Performs the command
|
23
|
+
# Performs the command if not in embedded mode
|
23
24
|
def call
|
25
|
+
return unless standalone?
|
26
|
+
|
24
27
|
::Process.kill('TSTP', ::Process.pid)
|
25
28
|
end
|
26
29
|
end
|
@@ -18,9 +18,12 @@ module Karafka
|
|
18
18
|
# Namespace for commands the process can react to
|
19
19
|
module Commands
|
20
20
|
# Sends a signal to stop the process
|
21
|
+
# @note Does not work in an embedded mode because we do not own the Ruby process.
|
21
22
|
class Stop < Base
|
22
|
-
# Performs the command
|
23
|
+
# Performs the command if not in embedded mode
|
23
24
|
def call
|
25
|
+
return unless standalone?
|
26
|
+
|
24
27
|
::Process.kill('QUIT', ::Process.pid)
|
25
28
|
end
|
26
29
|
end
|
@@ -25,6 +25,12 @@ module Karafka
|
|
25
25
|
config.instance_eval do
|
26
26
|
setting(:commanding, default: Commanding::Config.config)
|
27
27
|
end
|
28
|
+
|
29
|
+
# Expand UI config with extra search capabilities settings
|
30
|
+
config.ui.instance_eval do
|
31
|
+
setting(:search, default: Ui::Lib::Search::Config.config)
|
32
|
+
setting(:policies, default: Ui::Lib::Policies::Config.config)
|
33
|
+
end
|
28
34
|
end
|
29
35
|
|
30
36
|
# Runs post setup features configuration operations
|
@@ -32,6 +38,8 @@ module Karafka
|
|
32
38
|
# @param config [Karafka::Core::Configurable::Node]
|
33
39
|
def post_setup_all(config)
|
34
40
|
Commanding.post_setup(config)
|
41
|
+
Ui::Lib::Search.post_setup(config)
|
42
|
+
Ui::Lib::Policies.post_setup(config)
|
35
43
|
end
|
36
44
|
end
|
37
45
|
end
|
@@ -32,6 +32,19 @@ module Karafka
|
|
32
32
|
Karafka::Web.gem_root.join('lib/karafka/web/ui/views')
|
33
33
|
]
|
34
34
|
|
35
|
+
before do
|
36
|
+
assets_path = root_path("assets/#{Karafka::Web::VERSION}/")
|
37
|
+
|
38
|
+
# Always allow assets
|
39
|
+
break true if request.path.start_with?(assets_path)
|
40
|
+
# If policies extension is not loaded, allow as this is the default
|
41
|
+
break true unless Web.config.ui.respond_to?(:policies)
|
42
|
+
break true if Web.config.ui.policies.requests.allow?(env)
|
43
|
+
|
44
|
+
# Do not allow if given request violates requests policies
|
45
|
+
raise(Errors::Ui::ForbiddenError)
|
46
|
+
end
|
47
|
+
|
35
48
|
route do |r|
|
36
49
|
r.root { r.redirect root_path('dashboard') }
|
37
50
|
|
@@ -51,7 +64,6 @@ module Karafka
|
|
51
64
|
controller = Controllers::ConsumersController.new(params)
|
52
65
|
|
53
66
|
r.get 'overview' do
|
54
|
-
@breadcrumbs = false
|
55
67
|
controller.index
|
56
68
|
end
|
57
69
|
|
@@ -155,6 +167,13 @@ module Karafka
|
|
155
167
|
end
|
156
168
|
|
157
169
|
r.on 'explorer' do
|
170
|
+
r.get String, 'search' do |topic_id|
|
171
|
+
# Search has it's own controller but we want to have this in the explorer routing
|
172
|
+
# namespace because topic search is conceptually part of the explorer
|
173
|
+
controller = Controllers::SearchController.new(params)
|
174
|
+
controller.index(topic_id)
|
175
|
+
end
|
176
|
+
|
158
177
|
controller = Controllers::ExplorerController.new(params)
|
159
178
|
|
160
179
|
r.get String, Integer, 'recent' do |topic_id, partition_id|
|
@@ -262,16 +281,24 @@ module Karafka
|
|
262
281
|
r.on 'topics' do
|
263
282
|
controller = Controllers::TopicsController.new(params)
|
264
283
|
|
265
|
-
r.get String, 'config' do |
|
266
|
-
controller.config(
|
284
|
+
r.get String, 'config' do |topic_id|
|
285
|
+
controller.config(topic_id)
|
286
|
+
end
|
287
|
+
|
288
|
+
r.get String, 'replication' do |topic_id|
|
289
|
+
controller.replication(topic_id)
|
267
290
|
end
|
268
291
|
|
269
|
-
r.get String, '
|
270
|
-
controller.
|
292
|
+
r.get String, 'distribution' do |topic_id|
|
293
|
+
controller.distribution(topic_id)
|
271
294
|
end
|
272
295
|
|
273
|
-
r.get String, '
|
274
|
-
controller.
|
296
|
+
r.get String, 'offsets' do |topic_id|
|
297
|
+
controller.offsets(topic_id)
|
298
|
+
end
|
299
|
+
|
300
|
+
r.get String do |topic_id|
|
301
|
+
r.redirect root_path('topics', topic_id, 'config')
|
275
302
|
end
|
276
303
|
|
277
304
|
r.get do
|
@@ -308,6 +335,16 @@ module Karafka
|
|
308
335
|
controller = Controllers::StatusController.new(params)
|
309
336
|
controller.show
|
310
337
|
end
|
338
|
+
|
339
|
+
r.get 'ux' do
|
340
|
+
controller = Controllers::UxController.new(params)
|
341
|
+
controller.show
|
342
|
+
end
|
343
|
+
|
344
|
+
r.get 'support' do
|
345
|
+
controller = Controllers::SupportController.new(params)
|
346
|
+
controller.show
|
347
|
+
end
|
311
348
|
end
|
312
349
|
end
|
313
350
|
end
|
@@ -38,6 +38,7 @@ module Karafka
|
|
38
38
|
|
39
39
|
# @param partition_id [Integer] id of the partition of errors we are interested in
|
40
40
|
def partition(partition_id)
|
41
|
+
@topic_id = errors_topic
|
41
42
|
@partition_id = partition_id
|
42
43
|
@watermark_offsets = Models::WatermarkOffsets.find(errors_topic, @partition_id)
|
43
44
|
@partitions_count = Models::ClusterInfo.partitions_count(errors_topic)
|