Spring Boot actuator interview questions and answers
More Java interview questions and answers...- Spring Boot actuator interview questions and answers
- Spring Core - Interview Questions
- Top Spring Cloud Interview Questions
- Spring Security Interview Questions
- Spring MVC - Interview Questions
- Spring Webflux Interview Questions
- Top Spring Boot Interview Questions
- Spring Data JPA Interview Questions and Answers
- Top Mockito Interview Questions and Answers
- Java Collections Interview Questions
- Java Stream API Interview Questions and Answers - Frequently asked
- Quarkus - Interview questions and answers
- Spring Interview questions and answers
- Spring Boot actuator interview questions and answers
- Spring Core - Interview Questions
- Top Spring Cloud Interview Questions
- Spring Security Interview Questions
- Spring MVC - Interview Questions
- Spring Webflux Interview Questions
- Top Spring Boot Interview Questions
- Spring Data JPA Interview Questions and Answers
- Top Mockito Interview Questions and Answers
- Java Collections Interview Questions
- Java Stream API Interview Questions and Answers - Frequently asked
- Quarkus - Interview questions and answers
- Spring Interview questions and answers
1. What is the Spring Boot actuator?
An actuator is a tool with which we can monitor and manage our application. When the application is pushed into production it provides HTTP endpoints with which we can monitor and get metrics of our application. This monitoring and management information is exposed via REST-like endpoint URLs.
2. Which are the some of important and widely used actuator endpoints?
- /actuator - provides a hypermedia-based discovery page for all the other endpoints
- /env: Return list of properties in the current environment
- /auditevents: Returns all auto-configuration candidates and the reason why they ‘were’ or ‘were not’ applied.
- /health: Return application health information.
- /beans: Returns a complete list of all the Spring beans in your application.
- /dump: It performs a thread dump.
- /trace: Returns trace logs
- /metrics: It shows several useful metrics information like JVM memory used, system CPU usage, and much more.
- /info: displays the public application info
- /caches: Check available caches
- /flyway - provides all the information about your database migration scripts
3. How to enable Spring Boot actuator to our application?
To enable Spring Boot Actuator, we just need to add the spring-boot-actuator dependency to our package manager.
Maven users can add the below dependency in your pom.xml file:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
Gradle users can add the below dependency in your build.gradle file
compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator'
4. What are the protocols we can use to access actuator endpoints?
Spring Boot allows us to access actuator endpoints using both HTTP and JMX
5. What is Health Indicator?
The HealthEndpoint of spring-boot-starter-actuator module collects Health information for any beans that are defined as HealthIndicator.This health information is accessible at the /health endpoint and can be consumed by monitoring software. By default, multiple Health Indicators are auto-configured.
6. What is the Health Indicator status?
Following are some of the common health indicator status:
- UP: The status UP indicates the application is running.
- DOWN: The status will show DOWN if any of those health indicator components are ‘unhealthy’ for example a database is not reachable.
- OUT_OF_SERVICE — The component is out of service temporarily
- UNKNOWN — The component state is unknown
7. What is the metrics in the actuator?
Image result for What are spring metrics for?
The /metrics endpoint shows several useful metrics information like JVM memory used, system CPU usage, open files, and much more.
8. What are some metrics monitoring tools?
9. What is loggers for?
The /loggers endpoint shows the application’s logs and also lets you change the log level at runtime.
These levels can be one of:
- TRACE
- DEBUG
- INFO
- WARN
- ERROR
- FATAL
- OFF
- null
10. What is beans for?
/beans return a complete list of all the Spring beans in your application.
More Java interview questions and answers...- Spring Boot actuator interview questions and answers
- Spring Core - Interview Questions
- Top Spring Cloud Interview Questions
- Spring Security Interview Questions
- Spring MVC - Interview Questions
- Spring Webflux Interview Questions
- Top Spring Boot Interview Questions
- Spring Data JPA Interview Questions and Answers
- Top Mockito Interview Questions and Answers
- Java Collections Interview Questions
- Java Stream API Interview Questions and Answers - Frequently asked
- Quarkus - Interview questions and answers
- Spring Interview questions and answers
- Spring Boot actuator interview questions and answers
- Spring Core - Interview Questions
- Top Spring Cloud Interview Questions
- Spring Security Interview Questions
- Spring MVC - Interview Questions
- Spring Webflux Interview Questions
- Top Spring Boot Interview Questions
- Spring Data JPA Interview Questions and Answers
- Top Mockito Interview Questions and Answers
- Java Collections Interview Questions
- Java Stream API Interview Questions and Answers - Frequently asked
- Quarkus - Interview questions and answers
- Spring Interview questions and answers