@Endpoint(value="health", defaultSensitive=false) public class HealthEndpoint extends Object
Exposes an Endpoint
to provide information about the health of the application.
Modifier and Type | Class and Description |
---|---|
static class |
HealthEndpoint.StatusConfiguration
Configuration related to handling of the
HealthStatus . |
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_SENSITIVE
If the endpoint is sensitive if no configuration is provided.
|
static String |
NAME
Constant for health.
|
static String |
PREFIX
Prefix for health endpoint.
|
Constructor and Description |
---|
HealthEndpoint(HealthAggregator<HealthResult> healthAggregator,
HealthIndicator[] healthIndicators,
HealthIndicator[] livenessHealthIndicators) |
Modifier and Type | Method and Description |
---|---|
DetailsVisibility |
getDetailsVisible() |
Publisher<HealthResult> |
getHealth(Principal principal)
Return all health indicators.
|
Publisher<HealthResult> |
getHealth(Principal principal,
HealthCheckType selector)
Return health indicators based on the selector.
|
protected HealthIndicator[] |
getReadinessHealthIndicators(HealthIndicator[] allHealthIndicators,
HealthIndicator[] livenessHealthIndicators) |
HealthEndpoint.StatusConfiguration |
getStatusConfiguration() |
protected HealthLevelOfDetail |
levelOfDetail(Principal principal)
Returns the level of detail that should be returned by the endpoint.
|
void |
setDetailsVisible(DetailsVisibility detailsVisible)
Sets the visibility policy for health information.
|
void |
setStatusConfiguration(HealthEndpoint.StatusConfiguration statusConfiguration)
Sets the status configuration.
|
public static final boolean DEFAULT_SENSITIVE
public static final String NAME
public static final String PREFIX
public HealthEndpoint(HealthAggregator<HealthResult> healthAggregator, HealthIndicator[] healthIndicators, @Liveness HealthIndicator[] livenessHealthIndicators)
healthAggregator
- The HealthAggregator
healthIndicators
- The HealthIndicator
livenessHealthIndicators
- The HealthIndicator
qualified by Liveness
protected final HealthIndicator[] getReadinessHealthIndicators(HealthIndicator[] allHealthIndicators, HealthIndicator[] livenessHealthIndicators)
@Read @SingleResult public Publisher<HealthResult> getHealth(@Nullable Principal principal)
principal
- Authenticated userMono
@Read @SingleResult public Publisher<HealthResult> getHealth(@Nullable Principal principal, @Selector HealthCheckType selector)
principal
- Authenticated userselector
- HealthEndpointSelectorMono
public DetailsVisibility getDetailsVisible()
public void setDetailsVisible(DetailsVisibility detailsVisible)
detailsVisible
- The DetailsVisibility
public HealthEndpoint.StatusConfiguration getStatusConfiguration()
@Inject public void setStatusConfiguration(HealthEndpoint.StatusConfiguration statusConfiguration)
statusConfiguration
- The status configurationprotected HealthLevelOfDetail levelOfDetail(@Nullable Principal principal)
principal
- Authenticated userHealthLevelOfDetail