Spring Boot Actuator and Application Monitoring Quiz Quiz

Assess your understanding of Spring Boot Actuator features and best practices for application monitoring. This quiz covers endpoints, health checks, metrics, configuration, and monitoring strategies to help reinforce core concepts in efficient application observability.

  1. Purpose of the Actuator Module

    Which of the following best describes the primary purpose of the Spring Boot Actuator module?

    1. To generate HTML reports for user analytics
    2. To speed up web request processing
    3. To provide production-ready monitoring and management features
    4. To handle user authentication automatically

    Explanation: The Spring Boot Actuator module is designed to add monitoring and management capabilities to applications, such as health checks, metrics, and environment information. Speeding up web requests and user authentication are handled by different modules, not Actuator. Generating HTML reports for user analytics is outside the scope of Actuator's responsibilities.

  2. Enabling Actuator Endpoints

    What property must be set in the configuration to enable all actuator endpoints, including sensitive ones?

    1. management.endpoints.web.exposure.include=*
    2. monitoring.endpoints.enabled=yes
    3. spring.monitor.activate=all
    4. endpoints.all.enable=true

    Explanation: Setting 'management.endpoints.web.exposure.include=*' exposes all actuator endpoints, which may include sensitive ones. The other options do not exist in actuator configuration and would not have the desired effect. Care should be taken when exposing all endpoints to ensure security.

  3. Health Endpoint Output

    When you access the '/actuator/health' endpoint without authentication, what is typically displayed by default?

    1. A simple status such as 'UP' or 'DOWN'
    2. Database connection details
    3. A list of all environment variables
    4. The entire application log

    Explanation: By default, the health endpoint shows a concise status like 'UP' or 'DOWN' to avoid exposing sensitive details. Application logs, database information, and environment variables are not shown for security reasons. More detailed health info can be configured if needed.

  4. Custom Health Indicators

    If you want to add a custom readiness check for an API dependency in your application, what should you implement?

    1. A custom Repository
    2. A custom DataSource
    3. A custom ControllerAdvice
    4. A custom HealthIndicator

    Explanation: Implementing a custom HealthIndicator lets you add personalized health checks, such as checking external APIs. ControllerAdvice handles exceptions, Repository deals with data operations, and DataSource manages database connections but do not serve as health checks.

  5. Metrics Collection

    Which actuator endpoint provides runtime metrics like memory usage and active threads?

    1. /actuator/metrics
    2. /actuator/info
    3. /actuator/tasks
    4. /actuator/history

    Explanation: /actuator/metrics offers various runtime statistics including memory and thread information. The /actuator/info endpoint gives build or custom info, /actuator/tasks is not a standard endpoint, and /actuator/history is not used in actuator monitoring.

  6. Securing Endpoints

    Which is the recommended way to restrict access to sensitive actuator endpoints in a production environment?

    1. Configure security settings to require authentication
    2. Only log access attempts without other controls
    3. Switch endpoints to POST requests
    4. Remove the actuator dependency from the application

    Explanation: Configuring authentication and authorization for sensitive endpoints is the recommended security practice. Removing the dependency disables monitoring, while just logging access or relying on request methods is not secure. Proper security ensures control and visibility.

  7. Info Endpoint Usage

    A developer wants to include the application's version and description in the '/actuator/info' endpoint. Which configuration keys should be used?

    1. endpoint.version and endpoint.desc
    2. spring.infoVersion and spring.infoDesc
    3. management.version and management.description
    4. info.version and info.description

    Explanation: Setting info.version and info.description in properties files exposes them via the info endpoint. The other options are incorrect key formats and will not display the desired information on the info endpoint.

  8. Disabling an Endpoint

    How can a developer disable the '/actuator/shutdown' endpoint to prevent it from shutting down the application?

    1. Set shutdown.method=none
    2. Set management.endpoint.shutdown.enabled=false
    3. Uninstall the actuator package
    4. Delete the shutdown endpoint class

    Explanation: Setting management.endpoint.shutdown.enabled to false disables the shutdown functionality. Deleting classes or uninstalling the module removes all actuator features, and setting shutdown.method does not affect actuator endpoints. This property is the supported approach.

  9. Default Actuator Port

    If not configured otherwise, on which port do actuator endpoints run relative to the application's server port?

    1. Actuator endpoints require a dedicated port by default
    2. Actuator endpoints are not accessible without custom port mapping
    3. Actuator endpoints use the same port as the main application
    4. Actuator endpoints run only on port 8443

    Explanation: By default, actuator endpoints are available on the same port as the main application. They don't require a dedicated port unless configured. The other statements about ports are inaccurate for the default configuration.

  10. Viewing Application Beans

    Which actuator endpoint allows you to view a list of all beans created in the application context?

    1. /actuator/beans
    2. /actuator/services
    3. /actuator/plugins
    4. /actuator/settings

    Explanation: /actuator/beans displays all beans and their dependencies in the application context. The other endpoints either do not exist or do not serve this function, so they would not help with viewing application beans.