Skip to content

Fix Scan Server Status Icon colors in 4.0.0 Monitor - #6581

Open
Amemeda wants to merge 11 commits into
apache:mainfrom
Amemeda:6576-server-icons
Open

Amemeda wants to merge 11 commits into
apache:mainfrom
Amemeda:6576-server-icons

Conversation

@Amemeda

@Amemeda Amemeda commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

This pr fixes a bug in the 4.0.0 Monitor where the Scan Server status icon in the Server drop-down does not display the correct status color. Added new logic to correctly determine the color of the Scan Server status icons:

Scan Server Status Icon should be:

  • Green (OK) when responding servers = total servers (ex: 0/0 or 3/3)
  • Yellow (WARN) when responding servers is nonzero AND < total servers (ex: 1/3)
  • Red (ERROR) when responding servers = 0 AND total servers > 0 (ex: 0/3)

This pr closes #6576


OK Status:

image image

WARN Status: still updating

image image

ERROR Status: still updating

image

@Amemeda Amemeda changed the title Add new logic to determine server icon status Fix Server Status Icon colors in 4.0.0 Monitor Oct 7, 2026
@Amemeda
Amemeda marked this pull request as ready for review October 8, 2026 15:40
@DomGarguilo

Copy link
Copy Markdown
Member

I think there are some issues with this approach. This new code replaces the status the server sends with one recomputed from the counts which loses things the server already checks for (like WARN for servers that are not reporting metrics will now show green here). It also only fixes the scan servers circle in the drop down and does not properly affect the rolled up Servers circle which still uses the old status so it will stay red with 0 scan servers.

I think the only change we need is in getComponentStatus() in functions.js. Adding a new check "if status.hasServers is false AND the component type is scan server, return OK" since scan servers are optional. That would fix both status circles and the navbar.js changes can be reverted.

@Amemeda

Amemeda commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor Author

I think the only change we need is in getComponentStatus() in functions.js. Adding a new check "if status.hasServers is false AND the component type is scan server, return OK" since scan servers are optional. That would fix both status circles and the navbar.js changes can be reverted.

This introduces a problem for Scan Servers, In the case where there are no responding Scan Servers out of nonzero total, the icon should be red, but with that added logic it allows the icon to remain green. Is there a way for me to add to that condition to check the total scan servers?
image

It also stops the WARN status when scans servers is something like 1/3.
image

Comment on lines 577 to +593
function getComponentStatus(statusData, componentType) {
const status = statusData.componentStatuses[componentType];

// trying to get the component's server counts
const respondingServers = getServerCounts(status).at(0);
const totalServers = getServerCounts(status).at(1);

if (componentType === 'SCAN_SERVER'){
if (respondingServers === totalServers) {
return 'OK';
} else if (respondingServers === 0 && totalServers > 0) {
return 'ERROR';
} else if (respondingServers > 0 && respondingServers < totalServers){
return 'WARN'
}
}

@Amemeda Amemeda Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Created and implemented new function getServerCounts to get the current component's responding servers and total servers counts. I believe something like this is needed in order to properly set the expected status of only Scan Servers

@Amemeda Amemeda changed the title Fix Server Status Icon colors in 4.0.0 Monitor Fix Scan Server Status Icon colors in 4.0.0 Monitor Oct 9, 2026

This branch has not been deployed

No deployments
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.

4.0 Monitor - Servers menu icon bug

2 participants