I have designed one demo spring boot application CRUD operation with MySQL database. My application.properties file is as follow.
spring.boot.admin.url=http://localhost:8081
spring.datasource.url= jdbc:mysql://localhost:3306/springbootdb
spring.datasource.username=root
spring.datasource.password=admin
endpoints.health.sensitive=false
management.health.db.enabled=true
management.health.defaults.enabled=true
management.health.diskspace.enabled=true
spring.jpa.hibernate.ddl-auto=create-drop
POM.xml for the spring actuator is as follow.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>1.3.4</version>
</dependency>
When I try to hit the url "http://localhost:8080/health", I am getting {"status":"UP"} as response. I want to monitor my database (MySQL) with spring boot actuator. I want see my database status.
Can anyone please help ?
Add this configuration to your application.properties file
management.endpoint.health.show-details=always
In spring version 2.2.x is:
management.endpoint.health.show-details=always
by default this prop has value never.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With