Move endpoints.health.mapping to management.health.status.http-mapping

Closes gh-10052
This commit is contained in:
Stephane Nicoll
2017-08-22 11:11:22 +02:00
parent f2a74946af
commit 3087514b79
12 changed files with 40 additions and 73 deletions

View File

@@ -1139,7 +1139,6 @@ content into your application; rather pick only the properties that you need.
endpoints.health.cache.time-to-live=0 # Maximum time in milliseconds that a response can be cached.
endpoints.health.enabled=true # Enable the health endpoint.
endpoints.health.jmx.enabled=true # Expose the health endpoint as a JMX MBean.
endpoints.health.mapping= # Mapping of health statuses to HttpStatus codes. By default, registered health statuses map to sensible defaults (i.e. UP maps to 200).
endpoints.health.web.enabled=true # Expose the health endpoint as a Web endpoint.
# HEAP DUMP ENDPOINT ({sc-spring-boot-actuator}/endpoint/HeapDumpWebEndpoint.{sc-ext}[HeapDumpWebEndpoint])
@@ -1258,6 +1257,7 @@ content into your application; rather pick only the properties that you need.
management.health.rabbit.enabled=true # Enable RabbitMQ health check.
management.health.redis.enabled=true # Enable Redis health check.
management.health.solr.enabled=true # Enable Solr health check.
management.health.status.http-mapping= # Mapping of health statuses to HttpStatus codes. By default, registered health statuses map to sensible defaults (i.e. UP maps to 200).
management.health.status.order=DOWN, OUT_OF_SERVICE, UP, UNKNOWN # Comma-separated list of health statuses in order of severity.
# INFO CONTRIBUTORS ({sc-spring-boot-actuator}/autoconfigure/InfoContributorProperties.{sc-ext}[InfoContributorProperties])

View File

@@ -383,14 +383,16 @@ to your application properties:
The HTTP status code in the response reflects the overall health status (e.g. `UP`
maps to 200, `OUT_OF_SERVICE` or `DOWN` to 503). You might also want to register custom
status mappings with the `HealthMvcEndpoint` if you access the health endpoint over HTTP.
For example, the following maps `FATAL` to `HttpStatus.SERVICE_UNAVAILABLE`:
status mappings if you access the health endpoint over HTTP. For example, the following
maps `FATAL` to `HttpStatus.SERVICE_UNAVAILABLE`:
[source,properties,indent=0]
----
endpoints.health.mapping.FATAL=503
management.health.status.http-mapping.FATAL=503
----
TIP: If you need more control you can define your own `HealthStatusHttpMapper` bean.
The default status mappings for the built-in statuses are:
[cols="1,3"]