The property lists health and info, so only these endpoints are exposed.
Step 2: Understand what exposure.include controls
It controls which endpoints are accessible via HTTP; others remain hidden.
Final Answer:
Only /health and /info endpoints -> Option A
Quick Check:
Exposure include = health,info means only those endpoints [OK]
Hint: Check exposure.include list to know accessible endpoints [OK]
Common Mistakes:
Assuming all endpoints are exposed by default
Confusing exposure.include with enabling endpoints
Thinking metrics endpoint is included without listing it
4. You configured management.endpoints.web.exposure.include=health,metrics but the /metrics endpoint returns 404. What is the likely cause?
medium
A. The metrics endpoint is disabled by default and needs explicit enabling
B. The health endpoint is conflicting with metrics
C. The application is missing the actuator dependency
D. The server port is incorrect
Solution
Step 1: Check if actuator dependency is present
Without the actuator library, endpoints like /metrics won't exist, causing 404.
Step 2: Verify other options
Metrics endpoint is enabled by exposure.include; health does not conflict; server port affects access but not endpoint existence.
Final Answer:
The application is missing the actuator dependency -> Option C
Quick Check:
Missing actuator dependency = 404 on endpoints [OK]
Hint: Always add actuator dependency to use Actuator endpoints [OK]
Common Mistakes:
Assuming endpoints work without actuator dependency
Blaming port or conflicts instead of missing library
Thinking exposure.include enables endpoints without actuator
5. You want to monitor your Spring Boot app's health, info, and metrics endpoints but only expose health and info publicly. How do you configure this securely?
hard
A. Set management.endpoints.web.exposure.include=health,info,metrics and disable security
B. Set management.endpoints.web.exposure.include=health,info and secure /metrics with authentication
C. Expose all endpoints with * and rely on firewall rules
D. Disable all endpoints except metrics
Solution
Step 1: Expose only health and info endpoints publicly
Use management.endpoints.web.exposure.include=health,info to expose only those endpoints.
Step 2: Secure metrics endpoint separately
Keep metrics endpoint enabled internally and protect it with authentication or network rules.
Final Answer:
Set management.endpoints.web.exposure.include=health,info and secure /metrics with authentication -> Option B
Quick Check:
Expose only needed endpoints publicly, secure others [OK]
Hint: Expose only needed endpoints publicly; secure sensitive ones [OK]
Common Mistakes:
Exposing all endpoints without security
Disabling security to simplify access
Exposing metrics publicly without protection
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.