This is an automated email from the ASF dual-hosted git repository.
domgarguilo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push:
new d51c4837be Improve Monitor status LED notifications (#6202)
d51c4837be is described below
commit d51c4837be56b9dec61af09677ef0ed0f35a44f0
Author: Dom G. <[email protected]>
AuthorDate: Tue Mar 10 14:18:50 2026 -0400
Improve Monitor status LED notifications (#6202)
* add banners to pages to let the users know why the status LEDs for each
server component is showing ERROR or WARN
---
.../accumulo/monitor/resources/js/compactors.js | 41 ++++++++++++++++++++--
.../apache/accumulo/monitor/resources/js/navbar.js | 4 +--
.../accumulo/monitor/resources/js/tservers.js | 29 +++++++++++++--
.../accumulo/monitor/templates/compactors.ftl | 3 ++
.../apache/accumulo/monitor/templates/tservers.ftl | 3 ++
5 files changed, 72 insertions(+), 8 deletions(-)
diff --git
a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/compactors.js
b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/compactors.js
index a78504878c..a68b2c2835 100644
---
a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/compactors.js
+++
b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/compactors.js
@@ -20,15 +20,50 @@
var compactorsTable;
+/**
+ * Shows a red banner with the given message
+ */
+function showCompactorsBanner(message) {
+ $('#compactors-banner-message')
+ .removeClass('alert-warning')
+ .addClass('alert-danger')
+ .text(message);
+ $('#compactorsStatusBanner').show();
+}
+
+/**
+ * Show the error banner when there are no compactors
+ */
+function updateCompactorsBanner(compactors) {
+ if (!Array.isArray(compactors) || compactors.length === 0) {
+ showCompactorsBanner('No compactors are currently registered.');
+ } else {
+ $('#compactorsStatusBanner').hide();
+ }
+}
+
$(function () {
// display datatables errors in the console instead of in alerts
$.fn.dataTable.ext.errMode = 'throw';
compactorsTable = $('#compactorsTable').DataTable({
"autoWidth": false,
- "ajax": {
- "url": contextPath + 'rest-v2/ec/compactors',
- "dataSrc": "compactors"
+ "ajax": function (data, callback) {
+ $.ajax({
+ "url": contextPath + 'rest-v2/ec/compactors',
+ "method": 'GET'
+ }).done(function (response) {
+ var compactors = Array.isArray(response.compactors) ?
response.compactors : [];
+ updateCompactorsBanner(compactors);
+ callback({
+ "data": compactors
+ });
+ }).fail(function () {
+ showCompactorsBanner('Unable to retrieve compactor status.');
+ callback({
+ "data": []
+ });
+ });
},
"stateSave": true,
"dom": 't<"align-left"l>p',
diff --git
a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js
b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js
index 9be01a01a8..4edb81d209 100644
---
a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js
+++
b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js
@@ -144,7 +144,7 @@ function updateServerNotifications(statusData) {
}
/**
- * Updates the scan server notification based on REST v2 metrics status.
+ * Updates the scan server notification based on REST v2 status.
*/
function refreshSserverStatus() {
return getSserversView().done(function () {
@@ -156,7 +156,7 @@ function refreshSserverStatus() {
return;
}
- if (status.level === STATUS.WARN) {
+ if (status.hasProblemScanServers === true) {
sessionStorage.sServerStatus = STATUS.WARN;
updateElementStatus('sserverStatusNotification', STATUS.WARN);
} else {
diff --git
a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/tservers.js
b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/tservers.js
index d879c2d02b..981ec85762 100644
---
a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/tservers.js
+++
b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/tservers.js
@@ -18,7 +18,7 @@
*/
/* JSLint global definitions */
/*global
- $, sessionStorage, getTServers, getRecoveryList, bigNumberForQuantity,
timeDuration,
+ $, sessionStorage, getTServers, getRecoveryList, getStatus,
bigNumberForQuantity, timeDuration,
ajaxReloadTable
*/
"use strict";
@@ -69,12 +69,35 @@ function refreshTServersTable() {
ajaxReloadTable(tserversTable);
}
+/**
+ * If manager is down, tserver status will be ERROR. Add a banner to indicate
+ */
+function refreshTServersBanner(managerStatus) {
+ if (managerStatus === 'ERROR') {
+ $('#tserversManagerBanner').show();
+ $('#tservers_wrapper').hide();
+ $('#recovery-caption').hide();
+ } else {
+ $('#tserversManagerBanner').hide();
+ $('#tservers_wrapper').show();
+ }
+}
+
/**
* Makes the REST calls, generates the tables with the new information
*/
function refreshTServers() {
- getTServers().then(function () {
- refreshTServersTable();
+ getStatus().then(function () {
+ var managerStatus = JSON.parse(sessionStorage.status).managerStatus;
+ refreshTServersBanner(managerStatus);
+
+ if (managerStatus === 'ERROR') {
+ return;
+ }
+
+ getTServers().then(function () {
+ refreshTServersTable();
+ });
});
}
diff --git
a/server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/compactors.ftl
b/server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/compactors.ftl
index 2487d22743..3223bd1b3e 100644
---
a/server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/compactors.ftl
+++
b/server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/compactors.ftl
@@ -23,6 +23,9 @@
<h3>${title}</h3>
</div>
</div>
+ <div id="compactorsStatusBanner" style="display: none;">
+ <div id="compactors-banner-message" class="alert" role="alert"></div>
+ </div>
<div class="row">
<div class="col-xs-12">
<table id="compactorsTable" class="table caption-top table-bordered
table-striped table-condensed">
diff --git
a/server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/tservers.ftl
b/server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/tservers.ftl
index 0a5904b102..ac3368e946 100644
---
a/server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/tservers.ftl
+++
b/server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/tservers.ftl
@@ -23,6 +23,9 @@
<h3>${title}</h3>
</div>
</div>
+ <div id="tserversManagerBanner" style="display: none;">
+ <div class="alert alert-danger" role="alert">Manager Not Running</div>
+ </div>
<div class="row">
<div class="col-xs-12">
<span id="recovery-caption" style="background-color: gold; display:
none;">Highlighted rows correspond to tservers in recovery mode.</span>