Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
674d3dd2
Commit
674d3dd2
authored
Sep 09, 2019
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish health endpoint documentation for groups and nesting
Closes gh-14022
parent
cd8fab84
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
15 deletions
+20
-15
health.adoc
...tor-autoconfigure/src/main/asciidoc/endpoints/health.adoc
+16
-10
HealthEndpointDocumentationTests.java
...t/web/documentation/HealthEndpointDocumentationTests.java
+4
-5
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/health.adoc
View file @
674d3dd2
...
...
@@ -29,8 +29,9 @@ include::{snippets}health/response-fields.adoc[]
[[health-retrieving-component]]
== Retrieving the Health of a component
To retrieve the health of a particular component of the application, make a `GET` request
to `/actuator/health/\{component}`, as shown in the following curl-based example:
To retrieve the health of a particular component of the application's health, make a
`GET` request to `/actuator/health/\{component}`, as shown in the following curl-based
example:
include::{snippets}health/component/curl-request.adoc[]
...
...
@@ -42,20 +43,20 @@ include::{snippets}health/component/http-response.adoc[]
[[health-retrieving-component-response-structure]]
=== Response Structure
The response contains details of the health of a particular component of the
application.
The following table describes the structure of the response:
The response contains details of the health of a particular component of the
application's health.
The following table describes the structure of the response:
[cols="2,1,3"]
include::{snippets}health/component/response-fields.adoc[]
[[health-retrieving-component-
instance
]]
== Retrieving the Health of a
component instance
If a particular component con
sists of multiple instance
s (as the `broker` indicator in
the example above), the health of
a particular instance of that component can be retrieved
by issuing a `GET` request to `/actuator/health/\{component}/\{instance}`, as shown in the
following
curl-based example:
[[health-retrieving-component-
nested
]]
== Retrieving the Health of a
nested component
If a particular component con
tains other nested component
s (as the `broker` indicator in
the example above), the health of
such a nested component can be retrieved by issuing a
`GET` request to `/actuator/health/\{component}/\{subcomponent}`, as shown in the following
curl-based example:
include::{snippets}health/instance/curl-request.adoc[]
...
...
@@ -63,6 +64,11 @@ The resulting response is similar to the following:
include::{snippets}health/instance/http-response.adoc[]
Components of an application's health may be nested arbitrarily deep depending on the
application's health indicators and how they have been grouped. The health endpoint
supports any number of `/\{component}` identifiers in the URL to allow the health of a
component at any depth to be retrieved.
[[health-retrieving-component-instance-response-structure]]
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/HealthEndpointDocumentationTests.java
View file @
674d3dd2
...
...
@@ -78,12 +78,11 @@ class HealthEndpointDocumentationTests extends MockMvcEndpointDocumentationTests
.
description
(
"Status of a specific part of the application."
);
FieldDescriptor
componentDetails
=
subsectionWithPath
(
"details.*.details"
)
.
description
(
"Details of the health of a specific part of the application. "
+
"Presence is controlled by `management.endpoint.health.show-details`."
)
+
"Presence is controlled by `management.endpoint.health.show-details`. May contain nested "
+
"components that make up the health."
)
.
optional
();
FieldDescriptor
nestedComponents
=
subsectionWithPath
(
"details.*.details"
)
.
description
(
"Nested components that make up the health."
).
optional
();
this
.
mockMvc
.
perform
(
get
(
"/actuator/health"
)).
andExpect
(
status
().
isOk
()).
andDo
(
document
(
"health"
,
responseFields
(
status
,
components
,
componentStatus
,
componentDetails
,
nestedComponents
)));
this
.
mockMvc
.
perform
(
get
(
"/actuator/health"
)).
andExpect
(
status
().
isOk
())
.
andDo
(
document
(
"health"
,
responseFields
(
status
,
components
,
componentStatus
,
componentDetails
)));
}
@Test
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment