Spring Boot: Introduction to Custom Actuator Endpoints
Learn the basics of creating custom actuator endpoints in Spring Boot.
Questions in this quiz
15 questions on Spring Boot: Introduction to Custom Actuator Endpoints. Work through them here, then start the quiz to answer them and see your score.
1.What is the primary purpose of Spring Boot Actuator?
- ATo provide production-ready features for monitoring and managing applications
- BTo create RESTful web services
- CTo manage application security
- DTo handle database connections
2.Which dependency is required to use Spring Boot Actuator?
- Aspring-boot-starter-web
- Bspring-boot-starter-security
- Cspring-boot-starter-actuator
- Dspring-boot-starter-data-jpa
3.How can you expose all actuator endpoints in a Spring Boot application?
- ASet 'management.endpoint.health.show-details=always' in application.properties
- BSet 'spring.application.name=myapp' in application.properties
- CSet 'management.endpoints.web.exposure.include=*' in application.properties
- DSet 'server.port=8080' in application.properties
4.What is a custom actuator endpoint?
- AA default endpoint provided by Spring Boot
- BAn endpoint for handling HTTP requests
- CAn endpoint used to secure the application
- DAn endpoint created by the user to provide specific application metrics or information
5.Which annotation is used to create a custom actuator endpoint?
- A@RestController
- B@Endpoint
- C@Component
- D@Service
6.What method should be annotated to expose a custom actuator endpoint?
- A@PostMapping
- B@GetMapping
- C@ReadOperation
- D@RequestMapping
7.In which package should custom actuator endpoints be placed?
- Aorg.springframework.web.bind.annotation
- Bcom.example.demo.endpoint
- Corg.springframework.boot.actuate.endpoint
- Dorg.springframework.context.annotation
8.What is the default path prefix for actuator endpoints?
- A/admin
- B/monitor
- C/actuator
- D/api
9.How can you change the base path of actuator endpoints?
- ASet 'management.endpoints.web.base-path' in application.properties
- BSet 'server.servlet.context-path' in application.properties
- CSet 'spring.application.name' in application.properties
- DSet 'management.endpoint.health.enabled' in application.properties
10.Which operation type is NOT supported by actuator endpoints?
- ADelete
- BRead
- CWrite
- DUpdate
11.What is the purpose of the '@WriteOperation' annotation?
- ATo define a method that updates application state
- BTo define a method that reads application state
- CTo define a method that modifies application state
- DTo define a method that deletes application state
12.How do you disable a specific actuator endpoint?
- ASet 'server.port=0' in application.properties
- BSet 'management.endpoint.<name>.enabled=false' in application.properties
- CRemove the endpoint class from the project
- DSet 'management.endpoints.web.exposure.exclude=<name>' in application.properties
13.Which actuator endpoint provides application health information?
- A/actuator/env
- B/actuator/info
- C/actuator/health
- D/actuator/metrics
14.What is the default HTTP method for a '@ReadOperation'?
- APUT
- BPOST
- CGET
- DDELETE
15.Which annotation is used to define a method that deletes application state in a custom actuator endpoint?
- A@EraseOperation
- B@RemoveOperation
- C@ClearOperation
- D@DeleteOperation