Spring Boot Actuator - health checks, metrics, custom endpoints

    Question 1CORE SPRING BOOT - Actuator Purpose

    What is the primary purpose of Spring Boot Actuator?

    Question 2CORE SPRING BOOT - Enabling Actuator Endpoints

    How do you enable Spring Boot Actuator endpoints?

    Question 3CORE SPRING BOOT - Default Actuator Endpoints

    Which of the following is a default Spring Boot Actuator endpoint?

    Question 4CORE SPRING BOOT - Health Endpoint Check

    Which of the following statements about the `/health` endpoint is correct?

    Question 5CORE SPRING BOOT - Code Snippet (Custom Health Indicator)

    What will the following code do in a Spring Boot application?

    @Component public class CustomHealthIndicator implements HealthIndicator { @Override public Health health() { return Health.up().withDetail("customCheck", "All good!").build(); } }

    Question 6CORE SPRING BOOT - Code Snippet (Custom Metrics)

    What does the following code achieve?

    @Component public class CustomMetrics { @Autowired private MeterRegistry registry; public void incrementRequests() { registry.counter("custom.requests").increment(); } }

    Question 7CORE SPRING BOOT - Management Port

    How can you expose Actuator endpoints on a separate port than the application itself?

    Question 8CORE SPRING BOOT - Code Snippet (Custom Endpoint)

    What will this code create in a Spring Boot application?

    @Component @Endpoint(id = "custom") public class CustomEndpoint { @ReadOperation public String info() { return "Custom Endpoint Info"; } }

    Question 9CORE SPRING BOOT - Exposing All Endpoints

    By default, which Actuator endpoints are not exposed over HTTP?

    Question 10CORE SPRING BOOT - Best Practices for Actuator

    Which of the following is considered a best practice when using Spring Boot Actuator?