Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable spring boot actuator "health-component" and "health-component-instance"

Hi I am using actuator in sprinb-boot 2, with the following properties

management.endpoints.enabled-by-default=false
management.endpoint.health.enabled=true

My aim is to disable all endpoints except health. By this configuration I disabled all except health and getting the following endpoints now "health", "health-component", "health-component-instance" . Is it possible to disable "health-component", "health-component-instance" as well ? And how ?

like image 896
nairavs Avatar asked Nov 01 '25 00:11

nairavs


2 Answers

Health component endpoints were introduced in Spring Boot 2.2.0.M2 as an extension to already existing HealthEndpoint.

There is no configuration option to disable just /health-component and /health-component-instance, either the entire health endpoint is disabled or not.

like image 133
Karol Dowbecki Avatar answered Nov 03 '25 14:11

Karol Dowbecki


For SpringBoot 2.1.3 you can use the following in you application.yml:

#ENDPOINTS:
management:
  endpoints:
    web:
      exposure:
        include:
        - 'health'
        - 'info'

It will make only two listed endpoints available from actuator.

like image 43
AlexGera Avatar answered Nov 03 '25 13:11

AlexGera