Bird
0
0

You wrote a custom health indicator but the health endpoint does not show your custom status. What is a likely cause?

medium📝 Debug Q6 of 15
Spring Boot - Actuator
You wrote a custom health indicator but the health endpoint does not show your custom status. What is a likely cause?
AThe actuator dependency is missing from the project
BThe health() method returns Health.up() instead of Health.down()
CThe application.properties file is missing management.endpoint.health.enabled=true
DThe custom health indicator class is not annotated with @Component or registered as a bean
Step-by-Step Solution
Solution:
  1. Step 1: Check bean registration for custom health indicator

    Without @Component or bean registration, Spring won't detect the class.
  2. Step 2: Understand impact on health endpoint

    If not registered, custom health status won't appear regardless of method return.
  3. Final Answer:

    Missing @Component or bean registration -> Option D
  4. Quick Check:

    Custom health indicator must be a Spring bean [OK]
Quick Trick: Annotate custom health indicator with @Component to register [OK]
Common Mistakes:
  • Assuming method return value affects visibility
  • Missing actuator dependency causes no health endpoint at all

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes