Spring Boot: Actuator exposes health and metrics

Only /health and /info are exposed by default; anything else must be listed explicitly.

Code
// build.gradle: implementation 'org.springframework.boot:spring-boot-starter-actuator'

// application.yml
management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics,prometheus
  endpoint:
    health:
      show-details: when_authorized
Output
GET /actuator/health
{"status":"UP","components":{"db":{"status":"UP"},"diskSpace":{"status":"UP"}}}
Advertisement

Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.

Published 2026-08-11