Spring Boot Actuator is a powerful set of production-ready features that assist developers in monitoring and managing their applications. Here, we present a set of MCQ questions to test your knowledge of Spring Boot Actuator. Note that each question is followed by the correct answer and an explanation to help reinforce your knowledge.
1. Which Spring Boot starter dependency is required to enable Actuator features?
Answer:
Explanation:
The spring-boot-starter-actuator dependency adds all the required libraries to enable Actuator's functionalities.
2. Which Actuator endpoint provides metrics related to memory, garbage collection, and threads?
Answer:
Explanation:
The /metrics endpoint provides details about various application metrics including memory, GC, and threads.
3. Which Actuator endpoint displays application environment properties?
Answer:
Explanation:
The /env endpoint provides details about the application's environment properties.
4. By default, which Actuator endpoints are available over the web?
Answer:
Explanation:
For security reasons, only the /info and /health endpoints are exposed over the web by default.
5. How can you include all Actuator endpoints to be exposed over the web?
Answer:
Explanation:
The property management.endpoints.web.exposure.include=* allows all endpoints to be exposed over the web.
6. Which endpoint helps in accessing the current state of the application's loggers?
Answer:
Explanation:
The /loggers endpoint provides access to the application's loggers and allows modifications to their configurations.
7. What does the /health endpoint indicate if the application context failed to start?
Answer:
Explanation:
The /health endpoint would return a status of DOWN if the application context failed to start.
8. To change the default path prefix of actuator endpoints from /actuator, which property would you set?
Answer:
Explanation:
The management.endpoints.web.base-path property can be used to set a different path prefix.
9. Which endpoint provides a history of recent HTTP requests?
Answer:
Explanation:
The /http-trace endpoint provides a trace of recent HTTP requests.
10. How can you secure Actuator endpoints?
Answer:
Explanation:
Actuator endpoints can be secured using various methods like Basic Authentication, OAuth, JWT, and more.
11. Which Actuator endpoint provides details about the application’s build version, description, and custom metadata?
Answer:
Explanation:
The /info endpoint provides details about application metadata including build version, description, and custom attributes.
12. Which of the following is NOT an out-of-the-box status provided by the /health endpoint?
Answer:
Explanation:
HALTED is not an out-of-the-box status provided by the /health endpoint. The others, such as UP, DOWN, and OUT_OF_SERVICE, are default statuses.
Related Spring Boot MCQ Posts
- Spring Boot Starters MCQ - Multiple Choice Questions and Answers
- Spring Boot Auto Configurations MCQ - Multiple Choice Questions and Answers
- Spring Boot Properties & Configuration MCQ - Multiple Choice Questions and Answers
- Spring Boot Data Access MCQ - Multiple Choice Questions and Answers
- Spring Boot Actuator MCQ - Multiple Choice Questions and Answers
- Spring Boot Security MCQ - Multiple Choice Questions and Answers
- Spring Boot Testing MCQ - Multiple Choice Questions and Answers
- Spring Boot Microservices MCQ - Multiple Choice Questions and Answers
Comments
Post a Comment
Leave Comment