Spring Boot Actuator /health endpoint does not show database or file system information

jeremy simon picture jeremy simon · Apr 5, 2016 · Viewed 20.7k times · Source

I cannot get database information or filesystem information to show up on the /health endpoint. I only can get:

{
  "status": "UP"
}

Details about my setup and configuration: - Spring Boot 1.3.3 - Running the WAR on JBoss EAP 6.4 - Datasource is a JNDI resource. - Oracle is the database

spring:
  datasource:
    # Must match the datasource name in JBoss standalone.xml
    jndi-name: java:jboss/beautiful-ds
    driver-class-name: oracle.jdbc.driver.OracleDriver
  jpa:
    properties:
      # escapes reserved words used as column names (if any)
      globally_quoted_identifiers: true
    show-sql: true
    hibernate:
        naming_strategy: org.hibernate.cfg.EJB3NamingStrategy

server:
  servlet-path: /*

management:
  health:
    diskspace:
      enabled: true
    db:
      enabled: true
endpoints.health.sensitive: false

One thing i found on /configprops is this, which I'm not sure whether it is related:

  "spring.datasource.CONFIGURATION_PROPERTIES": {
    "prefix": "spring.datasource",
    "properties": {
      "error": "Cannot serialize 'spring.datasource'"
    }

I had tried adding "driver-class-name: oracle.jdbc.driver.OracleDriver" thinking it maybe needed more details, but that didn't change the situation.

so yeah, what gives? I made a vanilla example project which at least shows the filesystem stuff out the gate, so not sure why either don't want to show in my "real" app. Tell me your great and wise answers! :)

Answer

saikiran picture saikiran · Mar 17, 2018

By default Spring sets the below property to never. To be able to see full health details add the below property to your application.properties.

management.endpoint.health.show-details=always