Skip to content

Manager info on Monitor rest/manager -> rest-v2/manager#5894

Merged
kevinrr888 merged 6 commits intoapache:mainfrom
kevinrr888:4.0-feature-5882
Feb 2, 2026
Merged

Manager info on Monitor rest/manager -> rest-v2/manager#5894
kevinrr888 merged 6 commits intoapache:mainfrom
kevinrr888:4.0-feature-5882

Conversation

@kevinrr888
Copy link
Copy Markdown
Member

@kevinrr888 kevinrr888 commented Sep 18, 2025

Manager info on the Monitor (displayed on homepage (/) and Manager page (/manager)) now obtains and displays info from the existing (but unused) rest-v2/manager endpoint.

  • Updated the homepage to display table data corresponding to the rest-v2/manager endpoint.
  • Updated the manager page to display table data corresponding to the rest-v2/manager endpoint.
  • Created new endpoint rest-v2/manager/metrics which returns the Manager metrics as json. This is linked in the Manager table in both the homepage and the manager page.
  • Server navigation bar now only considers the Manager status (as obtained from rest/status) (ERROR, WARN, OK). Previously took into account the manager state (e.g., if the state or goal state was SAFE_MODE or CLEAN_STOP), but this info was only included in the rest/manager endpoint.
  • Deleted the rest/manager endpoint and associated code used to gather data for this endpoint.
  • Deleted systemAlert.js and systemAlert.ftl as this alert was entirely based on Manager info included in rest/manager (manager state being SAFE_MODE or CLEAN_STOP). No longer applicable with rest-v2/manager.
  • Removed no longer applicable tables: badTServersTable and deadTServersTable from /tservers page.

closes #5882

Manager info on the Monitor (displayed on homepage (`/`) and Manager page (`/manager`)) now obtains and displays info from the existing (but unused) `rest-v2/manager` endpoint.

* Updated the homepage to display table data corresponding to the `rest-v2/manager` endpoint.
* Updated the manager page to display table data corresponding to the `rest-v2/manager` endpoint.
* Created new endpoint `rest-v2/manager/metrics` which returns the Manager metrics as json. This is linked in the Manager table in both the homepage and the manager page.
* Server navigation bar now only considers the Manager status (as obtained from `rest/status`) (ERROR, WARN, OK). Previously took into account the manager state (e.g., if the state or goal state was SAFE_MODE or CLEAN_STOP), but this info was only included in the `rest/manager` endpoint.
* Deleted the `rest/manager` endpoint and associated code used to gather data for this endpoint.
* Deleted `systemAlert.js` and `systemAlert.ftl` as this alert was entirely based on Manager info included in `rest/manager` (manager state being SAFE_MODE or CLEAN_STOP). No longer applicable with `rest-v2/manager`.
@kevinrr888 kevinrr888 added this to the 4.0.0 milestone Sep 18, 2025
@kevinrr888 kevinrr888 self-assigned this Sep 18, 2025
@kevinrr888
Copy link
Copy Markdown
Member Author

The following are images of some of the Monitor pages with these changes

Image of homepage with Manager up:

image

Image of Manager page with Manager up:

image

Image of new rest-v2/manager/monitor endpoint

image

Image of existing rest-v2/manager endpoint (no metrics)

image

Image of homepage with Manager down:

image

Image of Manager page with Manager down:

image

@kevinrr888
Copy link
Copy Markdown
Member Author

The following are images of some of the Monitor pages before these changes

Image of homepage with Manager up:

image

Image of Manager page with Manager up:

image

Image of rest/manager endpoint

image

Image of homepage with Manager down:

image

Image of Manager page with Manager down:

image

Comment on lines -44 to -66
getManager().then(function () {
const managerData = JSON.parse(sessionStorage.manager);
const managerState = managerData.managerState;
const managerGoalState = managerData.managerGoalState;

const isStateGoalSame = managerState === managerGoalState;

// if the manager state is normal and the goal state is the same as the current state,
// or of the manager is not running, hide the state banner and return early
if ((managerState === 'NORMAL' && isStateGoalSame) || managerState === null) {
$('#managerStateBanner').hide();
return;
}

// update the manager state banner message and show it
let bannerMessage = 'Manager state: ' + managerState;
if (!isStateGoalSame) {
// only show the goal state if it differs from the manager's current state
bannerMessage += '. Manager goal state: ' + managerGoalState;
}
$('#manager-banner-message').text(bannerMessage);
$('#managerStateBanner').show();
});
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer applicable as the rest-v2/manager does not contain state of the manager.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add Metrics for the Manager.ManagerState enum?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#5894 (comment) (only first part relevant)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added metrics for Manager goal state in #6080

@ddanielr
Copy link
Copy Markdown
Contributor

Ran locally. The manager pages worked but I could never get metric information to display at rest-v2/manager/metrics
It would just return a 200 code and []

@ddanielr
Copy link
Copy Markdown
Contributor

Enabled auto-refresh and did get an error message

Uncaught ReferenceError: updateSystemAlerts is not defined
    at refreshNavBar (navbar.js:131:3)
    at functions.js:71:5

Comment on lines -44 to -66
getManager().then(function () {
const managerData = JSON.parse(sessionStorage.manager);
const managerState = managerData.managerState;
const managerGoalState = managerData.managerGoalState;

const isStateGoalSame = managerState === managerGoalState;

// if the manager state is normal and the goal state is the same as the current state,
// or of the manager is not running, hide the state banner and return early
if ((managerState === 'NORMAL' && isStateGoalSame) || managerState === null) {
$('#managerStateBanner').hide();
return;
}

// update the manager state banner message and show it
let bannerMessage = 'Manager state: ' + managerState;
if (!isStateGoalSame) {
// only show the goal state if it differs from the manager's current state
bannerMessage += '. Manager goal state: ' + managerGoalState;
}
$('#manager-banner-message').text(bannerMessage);
$('#managerStateBanner').show();
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add Metrics for the Manager.ManagerState enum?

});

// Generates the recovery table
recoveryListTable = $('#recoveryList').DataTable({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add metrics for recovery?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. I just made the front-end adhere to what is in the v2 endpoint. I don't know the history of why some things were removed from v1 to v2, but I assumed they were intentional.

Did you make this comment under the assumption I removed this code? This looks like a weird GitHub bug... This comment is showing that I deleted this code, but this has always been present in my commits. Very strange never seen something like this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added recovery metrics in #6081

- Fix error on using auto-refresh
- Move REST_V2_PREFIX to top of script
@kevinrr888
Copy link
Copy Markdown
Member Author

Ran locally. The manager pages worked but I could never get metric information to display at rest-v2/manager/metrics
It would just return a 200 code and []

Metrics aren't configured to emit by default. Can view the pictures I posted above for an idea, or configure accumulo to gather metrics.

Comment thread server/monitor/src/main/java/org/apache/accumulo/monitor/next/Endpoints.java Outdated
Did not properly auto-refresh "/manager" and "/" pages when the manager was
killed after the page was already loaded
Handles a couple edge cases for /manager endpoint:
- If manager is dead on first loading the page (in this case, no manager
  table is created), but later comes online
  and we are using the auto-refresh feature, previously would never
create the manager table. auto-refresh will now create the table if it
does not yet exist.
- There was a case where /manager could result in a DataTables
  alert/error. If the manager was up but the endpoint used to get the
table data was not yet available (small window where this could occur),
a DataTables alert would occur. Handle this instead as a console log and
populate the table with no data.
Comment on lines +31 to +47
"ajax": function (data, callback, settings) {
$.ajax({
url: contextPath + 'rest-v2/manager',
method: 'GET'
}).done(function (json) {
callback({
"data": [json]
});
}).fail(function (jqXHR, textStatus, errorThrown) {
// This is needed if the url is not yet available, but the manager is up. E.g., Short
// window where a 404 could occur, which would lead to DataTables error/alert w/out fail()
console.error("DataTables Ajax error :", errorThrown);
callback({
"data": []
});
});
},
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Differs from original impl to handle edge case described in #5894 (comment)

Copy link
Copy Markdown
Member

@DomGarguilo DomGarguilo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'll create some follow on tickets to re-enable the manager goal state and recovery features.

@kevinrr888
Copy link
Copy Markdown
Member Author

@dlmarion do you have any more comments/concerns? Otherwise, I'll merge this in

@dlmarion
Copy link
Copy Markdown
Contributor

dlmarion commented Feb 2, 2026

@dlmarion do you have any more comments/concerns? Otherwise, I'll merge this in

No issue with you merging this. @DomGarguilo captured the follow-ons.

@kevinrr888 kevinrr888 merged commit 480c88a into apache:main Feb 2, 2026
8 checks passed
@kevinrr888 kevinrr888 deleted the 4.0-feature-5882 branch February 2, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Monitor to use rest-v2/manager for front-end Manager info

4 participants