-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Provide an endpoint that provides a detailed view of the application's health #11869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The idea that we had when discussing this was to support injection of a
|
The enum coupled with Spring Security access rules might be a bit confusing. Users could end up with a combination of enum value and Spring Security access rules that don't really make sense. Another example where there might be a mismatch: the enum value is |
Thanks, Madhura. I agree, that does sound confusing. I think what we're trying to specify in the enum is what a 200 response will contain. The user then needs to configure things so that it's actually possible to get a 200 response… Right now, I can't see how we can do that without the possible confusion that you've described. |
We'll add the two endpoints back, but keep |
What are the implications of this on the addition of ping endpoint proposed in #11191? |
I don't think there are any implications. The two endpoints have different purposes. |
Having started implementing this, I'm not sure that the name @ReadOperation
public WebEndpointResponse<Health> getHealth() {
Status status = this.delegate.health().getStatus();
Integer httpStatus = this.statusHttpMapper.mapStatus(status);
return new WebEndpointResponse<>(Health.status(status).build(), httpStatus);
} It's getting the whole health, extracting just the status, and using that in the response. In other words, it looks to be doing exactly what you'd expect an endpoint named |
On second thoughts, I take that back. With the currently proposed arrangement, we'd end up with status returning the following: {
"status" : "UP",
"details" : {
"diskSpaceHealthIndicator" : {
"status" : "UP",
"details" : {
"total" : 94834171904,
"free" : 72733929472,
"threshold" : 10485760
}
},
"dataSourceHealthIndicator" : {
"status" : "UP",
"details" : {
"database" : "HSQL Database Engine",
"hello" : 1
}
}
}
} And health returning the following:
Having a health endpoint and a status endpoint where the health endpoint just shows the status is counterintuitive. |
Brainstorming ideas for the endpoint name, |
If the new endpoint's response is an extended view of |
Thanks for the suggestions. Given the difficulty of naming the new endpoint and the smell of having two endpoints that do the same thing, we're going to take another look at the approach described above. Our hope is that some well-named enum values couple with some documentation will avoid any confusing. The current thinking is to have a property for showing the details that is an enum with three values: |
How about For the rest of the post, I'd rather have this proposed solution than two endpoints too. |
What you're proposing isn't entirely clear to me. Are you proposing |
Sorry for not being clear. You seemed not to be sure with |
Thanks. I don't think |
👍 |
@mbhave has pointed out a flaw with the current design. As things stand, it's difficult to show an overview to anonymous users and show details to authorized users. The closest that you can get is to configure Spring Security to only allow access to users in the ANONYMOUS role and the role(s) required for authorised access. The principal check in the endpoint means the anonymous users and authorised users are shown the right thing, but authenticated unauthorised users are denied access entirely. It would be good if they could be shown an overview. |
I think the default of |
Uh oh!
There was an error while loading. Please reload this page.
We've been back and forth on this topic with the latest change being the drop of the
/status
endpoint in #11113There were a number of complaints about the fact we can't change the level of details based on the fact the request is authorized or not (see #11113 (comment)).
We've removed this feature because it was very complex to describe, in particular due to the
sensitive
flag. This flag has been removed so perhaps we should revisit our decision and restore some form of support for this.The text was updated successfully, but these errors were encountered: