Skip to content
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

Rework health response structure so that indicator or detail named status cannot clash #10249

Closed
wilkinsona opened this issue Sep 11, 2017 · 0 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@wilkinsona
Copy link
Member

wilkinsona commented Sep 11, 2017

if you have a bean named statusHealthIndicator (a bit contrived) or you add a detail named status (much more likely) then bad things happen:

{
 "status" : "UP",
 "diskSpace" : {
   "status" : "UP",
   "total" : 499046809600,
   "free" : 126894542848,
   "threshold" : 10485760
 },
 "dataSource" : {
   "status" : "UP",
   "database" : "HSQL Database Engine",
   "hello" : 1
 },
 "status" : {
   "status" : "UP",
   "status" : "Oops"
 }
}

Note the duplicate status keys at both levels.

The possibility of clashes could be removed by separating the details (aggregated indicators or individual health details):

{
  "status" : "UP",
  "details" : {
    "diskSpace" : {
      "status" : "UP",
      "details" : {
        "total" : 499046809600,
        "free" : 126893486080,
        "threshold" : 10485760
      }
    },
    "dataSource" : {
      "status" : "UP",
      "details" : {
        "database" : "HSQL Database Engine",
        "hello" : 1
      }
    },
    "status" : {
      "status" : "UP",
      "details" : {
        "status" : "Oops"
      }
    }
  }
}
@wilkinsona wilkinsona added this to the 2.0.0.M4 milestone Sep 11, 2017
@wilkinsona wilkinsona self-assigned this Sep 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant