codecentric / spring-boot-admin

Admin UI for administration of spring boot applications
Apache License 2.0
12.34k stars 3.08k forks source link

Missing endpoint links when application is in 'UNKNOWN' state #3095

Closed Hildebrand-Ritense closed 7 months ago

Hildebrand-Ritense commented 8 months ago

Spring Boot Admin Server information

Client information

Description

When the health state of an application is 'UNKNOWN', there are no links shown in the UI to the other endpoints (e.g. logging, log levels, etc.). When the application is reporting 'HEALTHY' again, the links are shown again in the menu.

SteKoe commented 8 months ago

Hi @Hildebrand-Ritense,

thanks for opening this issue. Unfortunately this is not a bug but intended behavior as Spring Boot Admin does not poll for endpoints, when the state of an instance is either unknown or offline. This results in "missing" endpoint links in the detail view of an instance. The 'UNKNOWN' state is set, when a new instance is registered at Spring Boot Admin Server or a unregistration of the service/instance is in progress.

You wrote that "When the application is reporting 'HEALTHY' again", what assumes, that your service is switching between UNKNOWN and HEALTHY state, right? Have you checked, why this might happen (e.g. service crashes and restarts)?

Regards, SteKoe

Hildebrand-Ritense commented 8 months ago

Hi @SteKoe,

Thank you for your prompt response. Good to know this not a bug.

At our applications we deliberately use the 'UNKNOWN' health state in case part of the application is in a suboptimal condition. We have a custom health indicator that reports 'UNKNOWN' for this part of the application. Per the actuator docs: "Status indicating that the component or subsystem is in an unknown state". This is the status that most closely resembles the actual state.

We know the application is not down, nor out of service, but we want to indicate part of the application requires attention.

Missing the links in the UI doesn't really fit this situation. What's your advise here?

SteKoe commented 8 months ago

Hi @Hildebrand-Ritense,

I suggest to use "RESTRICTED" as state. This state indicates that the service has a problem, but it is neither down nor completely working as expected.

Hildebrand-Ritense commented 8 months ago

Hi @SteKoe,

I've been able to run some tests with the one health indicator returning the custom state RESTRICTED instead. The aggregate health status still seems to become 'UNKNOWN' however, so I'm not sure this is a solution. I guess this requires a custom StatusAggregator then?

-- edit: ignore the above. I just found our app already has a custom StatusAggregator. Let me look at that first...

ulischulte commented 7 months ago

@Hildebrand-Ritense, If I'm not missing something (with respect to the pull request attached), there's nothing which keeps us from closing this issue, right? Cheers, Uli

Hildebrand-Ritense commented 7 months ago

That's right, with your advice we changed our application code (see PR above) and all is now working well. Thank you!