From 0c2dd18c175872c1ec9903125819729294e6d0f2 Mon Sep 17 00:00:00 2001 From: Iliia Khaprov Date: Fri, 14 Feb 2025 11:17:43 +0100 Subject: [PATCH 1/2] RMQ-1263: Shovels Management: show metrics (incl. forwarded counter) in the Shovel Status page (cherry picked from commit f90dab71f147548c5e9ad921a0bc618179bd34c2) Conflicts: deps/rabbitmq_shovel_management/src/rabbit_shovel_mgmt_util.erl (cherry picked from commit 6e871f6ab391b2b91bf64817b69f5ba3ca97c96f) --- .../priv/www/js/tmpl/shovels.ejs | 10 +++++++++- .../src/rabbit_shovel_mgmt_util.erl | 8 +++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/deps/rabbitmq_shovel_management/priv/www/js/tmpl/shovels.ejs b/deps/rabbitmq_shovel_management/priv/www/js/tmpl/shovels.ejs index d044a9dc03cf..b7b10e8540cc 100644 --- a/deps/rabbitmq_shovel_management/priv/www/js/tmpl/shovels.ejs +++ b/deps/rabbitmq_shovel_management/priv/www/js/tmpl/shovels.ejs @@ -17,6 +17,10 @@ Virtual Host <% } %> State + Remaining + Remaining Unacked + Pending + Forwarded Source Destination Last changed @@ -46,7 +50,11 @@ <%= shovel.timestamp %> <% } else { %> - <%= fmt_object_state(shovel) %> + <%= fmt_object_state(shovel) %> + <%= fmt_string(shovel.remaining) %> + <%= fmt_string(shovel.remaining_unacked) %> + <%= fmt_string(shovel.pending) %> + <%= fmt_string(shovel.forwarded) %> <%= fmt_string(shovel.src_protocol) %> <%= shovel.src_uri == undefined ? fmt_string(shovel.src_uri) : fmt_string(fmt_uri_with_credentials(shovel.src_uri)) %> <%= fmt_shovel_endpoint('src_', shovel) %> diff --git a/deps/rabbitmq_shovel_management/src/rabbit_shovel_mgmt_util.erl b/deps/rabbitmq_shovel_management/src/rabbit_shovel_mgmt_util.erl index bd3bd2c718c5..b4177861e160 100644 --- a/deps/rabbitmq_shovel_management/src/rabbit_shovel_mgmt_util.erl +++ b/deps/rabbitmq_shovel_management/src/rabbit_shovel_mgmt_util.erl @@ -42,9 +42,10 @@ status(Node) -> [format(Node, I) || I <- Status] end. -format(Node, {Name, Type, Info, _Metrics, TS}) -> +format(Node, {Name, Type, Info, Metrics, TS}) -> [{node, Node}, {timestamp, format_ts(TS)}] ++ format_name(Type, Name) ++ + format_metrics(Metrics) ++ format_info(Info); format(Node, {Name, Type, Info, TS}) -> [{node, Node}, {timestamp, format_ts(TS)}] ++ @@ -57,6 +58,11 @@ format_name(dynamic, {VHost, Name}) -> [{name, Name}, {vhost, VHost}, {type, dynamic}]. +format_metrics(undefined) -> + []; +format_metrics(Metrics) when is_map(Metrics) -> + maps:to_list(Metrics). + format_info(starting) -> [{state, starting}]; From 84e9aa4754e20281887d111a35780790e717dd88 Mon Sep 17 00:00:00 2001 From: Iliia Khaprov Date: Tue, 25 Mar 2025 21:19:45 +0100 Subject: [PATCH 2/2] RMQ-1263: Shovel Management - add help strings for shovel counters (cherry picked from commit 8e79a7f500c2df355f3ec7ac1fa1bdd3a8dff6a4) (cherry picked from commit 9efa0d9ffecb431df2f6092b503e489650a42501) --- .../priv/www/js/shovel.js | 13 +++++++++++++ .../priv/www/js/tmpl/shovels.ejs | 8 ++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/deps/rabbitmq_shovel_management/priv/www/js/shovel.js b/deps/rabbitmq_shovel_management/priv/www/js/shovel.js index 1a89aaa4777f..1188ba056c06 100644 --- a/deps/rabbitmq_shovel_management/priv/www/js/shovel.js +++ b/deps/rabbitmq_shovel_management/priv/www/js/shovel.js @@ -148,6 +148,19 @@ HELP['shovel-amqp10-auto-delete'] =
After num messages
\
The shovel will delete itself after the given number of messages have been transferred.
\ '; + +HELP['shovel-remaining-counter'] = + 'When not unlimited: number of messages left to transfer before this shovel will be deleted.'; + +HELP['shovel-remaining-unacked-counter'] = + 'When ack mode is on-confirm and Remaining is not unlimited: number of messages not yet acknowledged at the source.'; + +HELP['shovel-pending-counter'] = + 'When destination connection is blocked or doesn\'t have enough credits: number of messages that were cached.'; + +HELP['shovel-forwarded-counter'] = + 'Number of forwarded messages.'; + function remove_params_with(sammy, prefix) { for (var i in sammy.params) { if(i.startsWith(prefix)) { diff --git a/deps/rabbitmq_shovel_management/priv/www/js/tmpl/shovels.ejs b/deps/rabbitmq_shovel_management/priv/www/js/tmpl/shovels.ejs index b7b10e8540cc..92215322e1d4 100644 --- a/deps/rabbitmq_shovel_management/priv/www/js/tmpl/shovels.ejs +++ b/deps/rabbitmq_shovel_management/priv/www/js/tmpl/shovels.ejs @@ -17,10 +17,10 @@ Virtual Host <% } %> State - Remaining - Remaining Unacked - Pending - Forwarded + Remaining + Remaining Unacked + Pending + Forwarded Source Destination Last changed