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
@@ -1,12 +1,9 @@
|
|
1
|
-
<div class="
|
2
|
-
<div class="
|
3
|
-
<
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
</a>
|
9
|
-
</p>
|
10
|
-
</div>
|
1
|
+
<div class="topic-tile">
|
2
|
+
<div class="topic-tile-body">
|
3
|
+
<p class="topic-tile-text">
|
4
|
+
<a href="<%= root_path('topics', topic.topic_name, 'config') %>" class="topic-tile-link">
|
5
|
+
<%= topic.topic_name %> / <%= topic.partition_count %>
|
6
|
+
</a>
|
7
|
+
</p>
|
11
8
|
</div>
|
12
9
|
</div>
|
@@ -1,29 +1,25 @@
|
|
1
|
-
|
1
|
+
<% view_title @topic.topic_name %>
|
2
2
|
|
3
3
|
<%== partial 'topics/tabs' %>
|
4
4
|
|
5
|
-
<div class="
|
6
|
-
<
|
7
|
-
<
|
8
|
-
<
|
9
|
-
<
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
</tbody>
|
26
|
-
</table>
|
27
|
-
</div>
|
28
|
-
</div>
|
5
|
+
<div class="data-table-wrapper">
|
6
|
+
<table class="data-table">
|
7
|
+
<thead>
|
8
|
+
<tr>
|
9
|
+
<th><%== sort_link(:name) %></th>
|
10
|
+
<th><%== sort_link(:value) %></th>
|
11
|
+
<th><%== sort_link(:default?) %></th>
|
12
|
+
<th><%== sort_link(:sensitive?) %></th>
|
13
|
+
<th><%== sort_link(:read_only?) %></th>
|
14
|
+
</tr>
|
15
|
+
</thead>
|
16
|
+
<tbody>
|
17
|
+
<%==
|
18
|
+
each_partial(
|
19
|
+
@configs,
|
20
|
+
'cluster/config'
|
21
|
+
)
|
22
|
+
%>
|
23
|
+
</tbody>
|
24
|
+
</table>
|
29
25
|
</div>
|
@@ -1,7 +1,12 @@
|
|
1
|
-
<p class="text-end">
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
<p class="text-end mb-5">
|
2
|
+
<%==
|
3
|
+
value = number_with_delimiter @aggregated.sum.round, ' '
|
4
|
+
badge_primary("Total messages: #{value}")
|
5
|
+
%>
|
6
|
+
|
7
|
+
<%== badge_primary("Std dev: #{@aggregated.std_dev}") %>
|
8
|
+
<%== badge_primary("Std dev relative: #{@aggregated.std_dev_rel}%") %>
|
9
|
+
|
5
10
|
<% partitions_range = [@active_partitions.first, @active_partitions.last].uniq.join(' to ') %>
|
6
|
-
|
11
|
+
<%== badge_secondary("Partitions: #{partitions_range}") %>
|
7
12
|
</p>
|
@@ -1,2 +1,4 @@
|
|
1
1
|
<% data = { 'Estimated count': @distribution.map { [_1.partition_id, _1.count] } }.to_json %>
|
2
|
-
|
2
|
+
<div class="mb-5">
|
3
|
+
<%== partial 'shared/charts/bar', locals: { data: data, id: 'distribution' } %>
|
4
|
+
</div>
|
@@ -1,47 +1,42 @@
|
|
1
|
-
|
1
|
+
<% view_title @topic.topic_name %>
|
2
2
|
|
3
3
|
<%== partial 'topics/tabs' %>
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
<% if @limited %>
|
9
|
-
<%== partial 'topics/distribution/limited' %>
|
10
|
-
<% end %>
|
5
|
+
<% if @limited %>
|
6
|
+
<%== partial 'topics/distribution/limited' %>
|
7
|
+
<% end %>
|
11
8
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
9
|
+
<% if @aggregated.sum.zero? %>
|
10
|
+
<%== partial 'topics/distribution/empty_partitions' %>
|
11
|
+
<% else %>
|
12
|
+
<div class="col-span-12 mb-3">
|
13
|
+
<% if @active_partitions.size >= 2 %>
|
14
|
+
<%== partial 'topics/distribution/chart' %>
|
15
|
+
<% end %>
|
18
16
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
<div class="table-responsive">
|
23
|
-
<table class="bg-white table table-hover table-bordered table-striped mt-4 mb-4">
|
24
|
-
<thead>
|
25
|
-
<tr class="align-middle">
|
26
|
-
<th><%== sort_link(:partition_id) %></th>
|
27
|
-
<th><%== sort_link('Estimated count', :count) %></th>
|
28
|
-
<th><%== sort_link('Total share', :share) %></th>
|
29
|
-
<th><%== sort_link(:diff) %></th>
|
30
|
-
</tr>
|
31
|
-
</thead>
|
32
|
-
<tbody>
|
33
|
-
<%==
|
34
|
-
each_partial(
|
35
|
-
@distribution,
|
36
|
-
'topics/distribution/partition'
|
37
|
-
)
|
38
|
-
%>
|
39
|
-
</tbody>
|
40
|
-
</table>
|
41
|
-
</div>
|
42
|
-
</div>
|
43
|
-
<% end %>
|
17
|
+
<div id="refreshable" class="mt-4">
|
18
|
+
<%== partial 'topics/distribution/badges' %>
|
44
19
|
|
20
|
+
<div class="data-table-wrapper">
|
21
|
+
<table class="data-table">
|
22
|
+
<thead>
|
23
|
+
<tr>
|
24
|
+
<th><%== sort_link(:partition_id) %></th>
|
25
|
+
<th><%== sort_link('Estimated count', :count) %></th>
|
26
|
+
<th><%== sort_link('Total share', :share) %></th>
|
27
|
+
<th><%== sort_link(:diff) %></th>
|
28
|
+
</tr>
|
29
|
+
</thead>
|
30
|
+
<tbody>
|
31
|
+
<%==
|
32
|
+
each_partial(
|
33
|
+
@distribution,
|
34
|
+
'topics/distribution/partition'
|
35
|
+
)
|
36
|
+
%>
|
37
|
+
</tbody>
|
38
|
+
</table>
|
39
|
+
</div>
|
45
40
|
</div>
|
46
41
|
</div>
|
47
|
-
|
42
|
+
<% end %>
|
@@ -1,16 +1,14 @@
|
|
1
|
-
|
1
|
+
<% view_title 'Topics' %>
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
<% end %>
|
16
|
-
</div>
|
3
|
+
<% if @topics.empty? %>
|
4
|
+
<%== partial 'explorer/no_topics' %>
|
5
|
+
<% else %>
|
6
|
+
<div class="topic-tiles">
|
7
|
+
<%==
|
8
|
+
each_partial(
|
9
|
+
@topics,
|
10
|
+
'topics/topic'
|
11
|
+
)
|
12
|
+
%>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<% view_title @topic.topic_name %>
|
2
|
+
|
3
|
+
<%== partial 'topics/tabs' %>
|
4
|
+
|
5
|
+
<div class="data-table-wrapper">
|
6
|
+
<table class="data-table">
|
7
|
+
<thead>
|
8
|
+
<tr>
|
9
|
+
<th><%== sort_link(:partition_id) %></th>
|
10
|
+
<th><%== sort_link(:low) %></th>
|
11
|
+
<th><%== sort_link(:high) %></th>
|
12
|
+
<th><%== sort_link('Count', :diff) %></th>
|
13
|
+
</tr>
|
14
|
+
</thead>
|
15
|
+
<tbody>
|
16
|
+
<%==
|
17
|
+
each_partial(
|
18
|
+
@offsets,
|
19
|
+
'topics/partition_offsets'
|
20
|
+
)
|
21
|
+
%>
|
22
|
+
</tbody>
|
23
|
+
</table>
|
24
|
+
</div>
|
@@ -1,28 +1,24 @@
|
|
1
|
-
|
1
|
+
<% view_title @topic.topic_name %>
|
2
2
|
|
3
3
|
<%== partial 'topics/tabs' %>
|
4
4
|
|
5
|
-
<div class="
|
6
|
-
<
|
7
|
-
<
|
8
|
-
<
|
9
|
-
<
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
</tbody>
|
25
|
-
</table>
|
26
|
-
</div>
|
27
|
-
</div>
|
5
|
+
<div class="data-table-wrapper">
|
6
|
+
<table class="data-table">
|
7
|
+
<thead>
|
8
|
+
<tr>
|
9
|
+
<th><%== sort_link(:partition_id) %></th>
|
10
|
+
<th><%== sort_link(:leader) %></th>
|
11
|
+
<th><%== sort_link(:replica_count) %></th>
|
12
|
+
<th><%== sort_link('In sync brokers', :in_sync_replica_brokers) %></th>
|
13
|
+
</tr>
|
14
|
+
</thead>
|
15
|
+
<tbody>
|
16
|
+
<%==
|
17
|
+
each_partial(
|
18
|
+
@partitions,
|
19
|
+
'topics/partition'
|
20
|
+
)
|
21
|
+
%>
|
22
|
+
</tbody>
|
23
|
+
</table>
|
28
24
|
</div>
|
@@ -20,7 +20,7 @@ module Karafka
|
|
20
20
|
# Current schema version
|
21
21
|
# This can be used in the future for detecting incompatible changes and writing
|
22
22
|
# migrations
|
23
|
-
SCHEMA_VERSION = '1.
|
23
|
+
SCHEMA_VERSION = '1.4.0'
|
24
24
|
|
25
25
|
# @param schema_manager [Karafka::Web::Processing::Consumers::SchemaManager] schema
|
26
26
|
# manager that tracks the compatibility of schemas.
|
@@ -11,6 +11,7 @@ module Karafka
|
|
11
11
|
configure
|
12
12
|
|
13
13
|
required(:batches) { |val| val.is_a?(Integer) && val >= 0 }
|
14
|
+
required(:jobs) { |val| val.is_a?(Integer) && val >= 0 }
|
14
15
|
required(:messages) { |val| val.is_a?(Integer) && val >= 0 }
|
15
16
|
required(:retries) { |val| val.is_a?(Integer) && val >= 0 }
|
16
17
|
required(:dead) { |val| val.is_a?(Integer) && val >= 0 }
|
@@ -29,6 +29,7 @@ module Karafka
|
|
29
29
|
required(:threads) { |val| val.is_a?(Integer) && val >= 0 }
|
30
30
|
required(:workers) { |val| val.is_a?(Integer) && val.positive? }
|
31
31
|
required(:tags) { |val| val.is_a?(Karafka::Core::Taggable::Tags) }
|
32
|
+
required(:execution_mode) { |val| val.is_a?(String) && !val.empty? }
|
32
33
|
|
33
34
|
nested(:listeners) do
|
34
35
|
required(:active) { |val| val.is_a?(Integer) && val >= 0 }
|
@@ -60,6 +61,11 @@ module Karafka
|
|
60
61
|
required(:utilization) { |val| val.is_a?(Numeric) && val >= 0 }
|
61
62
|
|
62
63
|
nested(:total) do
|
64
|
+
# There can be jobs that run without new data batches like revocation, periodic,
|
65
|
+
# shutdown, etc. We want to track them. This is needed because in case of a
|
66
|
+
# setup where those are significant, user may have a false sense that nothing
|
67
|
+
# is happening in the system when no new messages are coming
|
68
|
+
required(:jobs) { |val| val.is_a?(Integer) && val >= 0 }
|
63
69
|
required(:batches) { |val| val.is_a?(Integer) && val >= 0 }
|
64
70
|
required(:messages) { |val| val.is_a?(Integer) && val >= 0 }
|
65
71
|
required(:errors) { |val| val.is_a?(Integer) && val >= 0 }
|
@@ -7,11 +7,15 @@ module Karafka
|
|
7
7
|
module Listeners
|
8
8
|
# Listener for listening on connections related events like polling, etc
|
9
9
|
class Connections < Base
|
10
|
-
#
|
11
|
-
# and we don't have to worry about it being always available
|
10
|
+
# Initializes the subscription group with defaults so it is always available
|
12
11
|
# @param event [Karafka::Core::Monitoring::Event]
|
13
12
|
def on_connection_listener_before_fetch_loop(event)
|
14
|
-
|
13
|
+
sg_id = event[:subscription_group].id
|
14
|
+
|
15
|
+
track do |sampler|
|
16
|
+
# This will initialize the hash upon first request
|
17
|
+
sampler.subscription_groups[sg_id]
|
18
|
+
end
|
15
19
|
end
|
16
20
|
|
17
21
|
# When fetch loop is done it means this subscription group is no longer active and we
|
@@ -36,9 +40,7 @@ module Karafka
|
|
36
40
|
sg_id = event[:subscription_group].id
|
37
41
|
|
38
42
|
track do |sampler|
|
39
|
-
sampler.subscription_groups[sg_id] =
|
40
|
-
polled_at: monotonic_now
|
41
|
-
}
|
43
|
+
sampler.subscription_groups[sg_id][:polled_at] = monotonic_now
|
42
44
|
end
|
43
45
|
end
|
44
46
|
end
|
@@ -51,6 +51,7 @@ module Karafka
|
|
51
51
|
track do |sampler|
|
52
52
|
# We count batches and messages prior to the execution, so they are tracked even
|
53
53
|
# if error occurs, etc.
|
54
|
+
sampler.counters[:jobs] += 1
|
54
55
|
sampler.counters[:batches] += 1
|
55
56
|
sampler.counters[:messages] += messages_count
|
56
57
|
sampler.jobs[jid] = job_details
|
@@ -120,6 +121,7 @@ module Karafka
|
|
120
121
|
job_details = job_details(consumer, '#{action}')
|
121
122
|
|
122
123
|
track do |sampler|
|
124
|
+
sampler.counters[:jobs] += 1
|
123
125
|
sampler.jobs[jid] = job_details
|
124
126
|
end
|
125
127
|
end
|
@@ -6,13 +6,6 @@ module Karafka
|
|
6
6
|
module Consumers
|
7
7
|
# Reports the collected data about the process and sends it, so we can use it in the UI
|
8
8
|
class Reporter < Tracking::Reporter
|
9
|
-
# Minimum number of messages to produce to produce them in sync mode
|
10
|
-
# This acts as a small back-off not to overload the system in case we would have
|
11
|
-
# extremely big number of errors happening
|
12
|
-
PRODUCE_SYNC_THRESHOLD = 25
|
13
|
-
|
14
|
-
private_constant :PRODUCE_SYNC_THRESHOLD
|
15
|
-
|
16
9
|
# This mutex is shared between tracker and samplers so there is no case where metrics
|
17
10
|
# would be collected same time tracker reports
|
18
11
|
MUTEX = Mutex.new
|
@@ -134,7 +127,7 @@ module Karafka
|
|
134
127
|
# normal operations we should not have that many messages to dispatch and it should not
|
135
128
|
# slowdown any processing.
|
136
129
|
def produce(messages)
|
137
|
-
if messages.count >=
|
130
|
+
if messages.count >= sync_threshold
|
138
131
|
::Karafka::Web.producer.produce_many_sync(messages)
|
139
132
|
else
|
140
133
|
::Karafka::Web.producer.produce_many_async(messages)
|
@@ -145,6 +138,11 @@ module Karafka
|
|
145
138
|
rescue WaterDrop::Errors::ProducerClosedError
|
146
139
|
nil
|
147
140
|
end
|
141
|
+
|
142
|
+
# @return [Integer] min number of messages when we switch to sync flushing to slow things
|
143
|
+
def sync_threshold
|
144
|
+
@sync_threshold ||= ::Karafka::Web.config.tracking.consumers.sync_threshold
|
145
|
+
end
|
148
146
|
end
|
149
147
|
end
|
150
148
|
end
|
@@ -15,10 +15,12 @@ module Karafka
|
|
15
15
|
# Current schema version
|
16
16
|
# This is used for detecting incompatible changes and not using outdated data during
|
17
17
|
# upgrades
|
18
|
-
SCHEMA_VERSION = '1.
|
18
|
+
SCHEMA_VERSION = '1.4.0'
|
19
19
|
|
20
20
|
# Counters that count events occurrences during the given window
|
21
21
|
COUNTERS_BASE = {
|
22
|
+
# Number of processed jobs of any type
|
23
|
+
jobs: 0,
|
22
24
|
# Number of processed batches
|
23
25
|
batches: 0,
|
24
26
|
# Number of processed messages
|
@@ -38,13 +40,21 @@ module Karafka
|
|
38
40
|
|
39
41
|
@windows = Helpers::Ttls::Windows.new
|
40
42
|
@counters = COUNTERS_BASE.dup
|
43
|
+
|
41
44
|
@consumer_groups = Hash.new do |h, cg_id|
|
42
45
|
h[cg_id] = {
|
43
46
|
id: cg_id,
|
44
47
|
subscription_groups: {}
|
45
48
|
}
|
46
49
|
end
|
47
|
-
|
50
|
+
|
51
|
+
@subscription_groups = Hash.new do |h, sg_id|
|
52
|
+
h[sg_id] = {
|
53
|
+
id: sg_id,
|
54
|
+
polled_at: monotonic_now
|
55
|
+
}
|
56
|
+
end
|
57
|
+
|
48
58
|
@errors = []
|
49
59
|
@pauses = {}
|
50
60
|
@jobs = {}
|
@@ -73,6 +83,7 @@ module Karafka
|
|
73
83
|
id: process_id,
|
74
84
|
started_at: started_at,
|
75
85
|
status: ::Karafka::App.config.internal.status.to_s,
|
86
|
+
execution_mode: ::Karafka::Server.execution_mode.to_s,
|
76
87
|
listeners: listeners,
|
77
88
|
workers: workers,
|
78
89
|
memory_usage: @memory_usage,
|
@@ -148,7 +159,7 @@ module Karafka
|
|
148
159
|
|
149
160
|
# We divide by 1_000 to convert from milliseconds
|
150
161
|
# We multiply by 100 to have it in % scale
|
151
|
-
totals.sum / 1_000 / workers / timefactor * 100
|
162
|
+
(totals.sum / 1_000 / workers / timefactor * 100).round(2)
|
152
163
|
end
|
153
164
|
|
154
165
|
# @return [Hash] number of active and standby listeners
|
@@ -294,12 +305,12 @@ module Karafka
|
|
294
305
|
@consumer_groups.each_value do |cg_details|
|
295
306
|
cg_details.each do
|
296
307
|
cg_details.fetch(:subscription_groups, {}).each do |sg_id, sg_details|
|
297
|
-
# This should be always available, since
|
308
|
+
# This should be always available, since the subscription group polled at time
|
298
309
|
# is first initialized before we start polling, there should be no case where
|
299
310
|
# we have statistics about a given subscription group but we do not have the
|
300
311
|
# last polling time
|
301
312
|
polled_at = subscription_groups.fetch(sg_id).fetch(:polled_at)
|
302
|
-
sg_details[:state][:poll_age] = monotonic_now - polled_at
|
313
|
+
sg_details[:state][:poll_age] = (monotonic_now - polled_at).round(2)
|
303
314
|
end
|
304
315
|
end
|
305
316
|
end
|
data/lib/karafka/web/ui/app.rb
CHANGED
@@ -27,12 +27,21 @@ module Karafka
|
|
27
27
|
end
|
28
28
|
|
29
29
|
r.on 'consumers' do
|
30
|
+
%w[
|
31
|
+
performance
|
32
|
+
controls
|
33
|
+
commands
|
34
|
+
].each do |path|
|
35
|
+
r.get path do |_process_id|
|
36
|
+
raise Errors::Ui::ProOnlyError
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
30
40
|
r.get String, 'subscriptions' do |_process_id|
|
31
41
|
raise Errors::Ui::ProOnlyError
|
32
42
|
end
|
33
43
|
|
34
44
|
r.get do
|
35
|
-
@breadcrumbs = false
|
36
45
|
controller = Controllers::ConsumersController.new(params)
|
37
46
|
controller.index
|
38
47
|
end
|
@@ -108,6 +117,16 @@ module Karafka
|
|
108
117
|
controller = Controllers::StatusController.new(params)
|
109
118
|
controller.show
|
110
119
|
end
|
120
|
+
|
121
|
+
r.get 'ux' do
|
122
|
+
controller = Controllers::UxController.new(params)
|
123
|
+
controller.show
|
124
|
+
end
|
125
|
+
|
126
|
+
r.get 'support' do
|
127
|
+
controller = Controllers::SupportController.new(params)
|
128
|
+
controller.show
|
129
|
+
end
|
111
130
|
end
|
112
131
|
end
|
113
132
|
end
|
data/lib/karafka/web/ui/base.rb
CHANGED
@@ -7,7 +7,7 @@ module Karafka
|
|
7
7
|
class Base < Roda
|
8
8
|
include Helpers::PathsHelper
|
9
9
|
include Helpers::ApplicationHelper
|
10
|
-
include Helpers::
|
10
|
+
include Helpers::TailwindHelper
|
11
11
|
|
12
12
|
# Details that need to be evaluated in the context of OSS or Pro web UI.
|
13
13
|
# If those would be evaluated in the base, they would not be initialized as expected
|
@@ -17,7 +17,9 @@ module Karafka
|
|
17
17
|
root: Karafka::Web.gem_root.join('lib/karafka/web/ui/public'),
|
18
18
|
# Cache all static files for the end user for as long as possible
|
19
19
|
# We can do it because we ship per version assets so they invalidate with gem bumps
|
20
|
-
headers: { 'Cache-Control' => 'max-age=31536000, immutable' }
|
20
|
+
headers: { 'Cache-Control' => 'max-age=31536000, immutable' },
|
21
|
+
gzip: true,
|
22
|
+
brotli: true
|
21
23
|
)
|
22
24
|
plugin :render_each
|
23
25
|
plugin :partials
|
@@ -35,6 +37,9 @@ module Karafka
|
|
35
37
|
plugin :hooks
|
36
38
|
plugin :flash
|
37
39
|
plugin :path
|
40
|
+
plugin :capture_erb
|
41
|
+
plugin :content_for
|
42
|
+
plugin :inject_erb
|
38
43
|
|
39
44
|
# Based on
|
40
45
|
# https://github.com/sidekiq/sidekiq/blob/ae6ca119/lib/sidekiq/web/application.rb#L8
|
@@ -48,7 +53,7 @@ module Karafka
|
|
48
53
|
csp.manifest_src "'self'"
|
49
54
|
csp.media_src "'self'"
|
50
55
|
csp.object_src "'none'"
|
51
|
-
csp.script_src "'self' https: http:
|
56
|
+
csp.script_src "'self' https: http:"
|
52
57
|
csp.style_src "'self' https: http: 'unsafe-inline'"
|
53
58
|
csp.worker_src "'self'"
|
54
59
|
csp.base_uri "'self'"
|
@@ -60,12 +65,6 @@ module Karafka
|
|
60
65
|
render_response(result)
|
61
66
|
end
|
62
67
|
|
63
|
-
handle_block_result Controllers::Responses::Deny do
|
64
|
-
@error = true
|
65
|
-
response.status = 403
|
66
|
-
view 'shared/exceptions/not_allowed'
|
67
|
-
end
|
68
|
-
|
69
68
|
# Redirect either to referer back or to the desired path
|
70
69
|
handle_block_result Controllers::Responses::Redirect do |result|
|
71
70
|
# Map redirect flashes (if any) to Roda flash messages
|
@@ -84,13 +83,18 @@ module Karafka
|
|
84
83
|
plugin :error_handler, classes: [
|
85
84
|
::Rdkafka::RdkafkaError,
|
86
85
|
Errors::Ui::NotFoundError,
|
87
|
-
Errors::Ui::ProOnlyError
|
86
|
+
Errors::Ui::ProOnlyError,
|
87
|
+
Errors::Ui::ForbiddenError
|
88
88
|
] do |e|
|
89
89
|
@error = true
|
90
90
|
|
91
|
-
|
91
|
+
case e
|
92
|
+
when Errors::Ui::ProOnlyError
|
92
93
|
response.status = 402
|
93
94
|
view 'shared/exceptions/pro_only'
|
95
|
+
when Errors::Ui::ForbiddenError
|
96
|
+
response.status = 403
|
97
|
+
view 'shared/exceptions/not_allowed'
|
94
98
|
else
|
95
99
|
response.status = 404
|
96
100
|
view 'shared/exceptions/not_found'
|
@@ -128,15 +132,17 @@ module Karafka
|
|
128
132
|
# the query data. Query data takes priority over request params.
|
129
133
|
# @param query_data [Hash] query params we want to add to the current path
|
130
134
|
path :current do |query_data = {}|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
135
|
+
# Merge existing request parameters with new query data
|
136
|
+
merged_params = request.params.deep_merge(query_data)
|
137
|
+
|
138
|
+
# Flatten the merged parameters
|
139
|
+
flattened_params = flatten_params('', merged_params)
|
140
|
+
|
141
|
+
# Build the query string from the flattened parameters
|
142
|
+
query_string = URI.encode_www_form(flattened_params)
|
143
|
+
|
144
|
+
# Construct the full path with query string
|
145
|
+
[request.path, query_string].compact.join('?')
|
140
146
|
end
|
141
147
|
|
142
148
|
# Sets appropriate template variables based on the response object and renders the
|