Bird
Raised Fist0
Spring Bootframework~10 mins

Actuator endpoints overview in Spring Boot - Step-by-Step Execution

Choose your learning style10 modes available
Concept Flow - Actuator endpoints overview
Start Spring Boot App
↓
Actuator Enabled?
No→No Endpoints Available
Yes↓
Expose Endpoints
↓
User Sends HTTP Request
↓
Match Endpoint
↓
Execute Endpoint Logic
↓
Return JSON Response
↓
User Sees Health, Metrics, Info, etc.
Shows how Spring Boot starts, enables actuator, exposes endpoints, handles requests, and returns info.
Execution Sample
Spring Boot
GET /actuator/health
GET /actuator/metrics
GET /actuator/info
User requests common actuator endpoints to get app health, metrics, and info.
Execution Table
StepActionRequest URLEndpoint MatchedResponse Content
1App starts with actuator enabled---
2User sends HTTP GET/actuator/healthhealth{"status":"UP"}
3User sends HTTP GET/actuator/metricsmetrics{"mem.used":12345678}
4User sends HTTP GET/actuator/infoinfo{"app":{"version":"1.0.0"}}
5User sends HTTP GET/actuator/envenv{"propertySources":["..."]}
6User sends HTTP GET/actuator/unknownnone{"error":"Not Found"}
💡 Requests stop after all actuator endpoints are demonstrated or unknown endpoint returns error.
Variable Tracker
VariableStartAfter Step 2After Step 3After Step 4After Step 5After Step 6
App StatusStartingRunningRunningRunningRunningRunning
Last Request URL-/actuator/health/actuator/metrics/actuator/info/actuator/env/actuator/unknown
Last Endpoint Matched-healthmetricsinfoenvnone
Last Response-{"status":"UP"}{"mem.used":12345678}{"app":{"version":"1.0.0"}}{"propertySources":["..."]}{"error":"Not Found"}
Key Moments - 2 Insights
Why do some actuator endpoints return detailed info while others return errors?
Because only enabled and exposed endpoints respond with data; unknown or disabled endpoints return errors as shown in step 6 of the execution_table.
How does the app know which endpoint to run when a request comes in?
The app matches the request URL to known actuator endpoints like /health or /metrics, as shown in the 'Endpoint Matched' column in the execution_table.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the response content when the user requests /actuator/health?
A{"status":"UP"}
B{"mem.used":12345678}
C{"app":{"version":"1.0.0"}}
D{"error":"Not Found"}
💡 Hint
Check row 2 under 'Response Content' in the execution_table.
At which step does the app respond with an error because the endpoint is unknown?
AStep 4
BStep 6
CStep 3
DStep 2
💡 Hint
Look for the row where 'Endpoint Matched' is 'none' in the execution_table.
If actuator was disabled, what would happen when a user requests /actuator/health?
AReturn health status JSON
BReturn metrics JSON
CReturn 'Not Found' error
DReturn info JSON
💡 Hint
Refer to the concept_flow where actuator enabled check leads to no endpoints if disabled.
Concept Snapshot
Spring Boot Actuator exposes HTTP endpoints like /health, /metrics, /info.
App must enable actuator to expose these.
User sends HTTP GET requests to endpoints.
App matches URL, runs logic, returns JSON response.
Unknown endpoints return errors.
Useful for monitoring app health and info.
Full Transcript
Spring Boot Actuator is a tool that adds special HTTP endpoints to your app. When the app starts with actuator enabled, it exposes URLs like /actuator/health, /actuator/metrics, and /actuator/info. When a user sends a GET request to these URLs, the app matches the request to the correct endpoint, runs the code to gather data, and sends back a JSON response. For example, /actuator/health returns the app's health status as {"status":"UP"}. If the user requests an unknown endpoint, the app returns a 'Not Found' error. This helps developers and operators check the app's status and metrics easily.

Practice

(1/5)
1. What is the main purpose of Spring Boot Actuator endpoints?
easy
A. To handle user authentication and authorization
B. To serve static web content like images and CSS
C. To manage database connections automatically
D. To provide information about the application's health and status

Solution

  1. Step 1: Understand Actuator endpoints role

    Actuator endpoints are designed to give quick info about the app's health and status.
  2. Step 2: Compare with other options

    Authentication, database management, and static content serving are not the main roles of Actuator.
  3. Final Answer:

    To provide information about the application's health and status -> Option D
  4. Quick Check:

    Actuator endpoints = app health info [OK]
Hint: Remember: Actuator = app health and metrics info [OK]
Common Mistakes:
  • Confusing Actuator with security features
  • Thinking Actuator manages database connections
  • Assuming Actuator serves static files
2. Which property enables the exposure of all Actuator endpoints in Spring Boot?
easy
A. management.endpoints.web.exposure.include=*
B. spring.boot.actuator.enabled=true
C. management.endpoint.health.enabled=true
D. server.port=8080

Solution

  1. Step 1: Identify property to expose endpoints

    The property management.endpoints.web.exposure.include=* exposes all Actuator endpoints.
  2. Step 2: Check other options

    spring.boot.actuator.enabled is not a valid property; health endpoint enabling is specific, and server.port sets the server port.
  3. Final Answer:

    management.endpoints.web.exposure.include=* -> Option A
  4. Quick Check:

    Expose all endpoints = management.endpoints.web.exposure.include=* [OK]
Hint: Use '*' in exposure.include to enable all endpoints [OK]
Common Mistakes:
  • Using incorrect property names
  • Confusing enabling endpoints with enabling server
  • Trying to enable endpoints individually without exposure property
3. Given the following configuration:
management.endpoints.web.exposure.include=health,info

Which endpoints will be accessible via HTTP?
medium
A. Only /health and /info endpoints
B. All Actuator endpoints
C. No endpoints are accessible
D. Only /metrics endpoint

Solution

  1. Step 1: Read the exposure.include property

    The property lists health and info, so only these endpoints are exposed.
  2. Step 2: Understand what exposure.include controls

    It controls which endpoints are accessible via HTTP; others remain hidden.
  3. Final Answer:

    Only /health and /info endpoints -> Option A
  4. 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

  1. Step 1: Check if actuator dependency is present

    Without the actuator library, endpoints like /metrics won't exist, causing 404.
  2. Step 2: Verify other options

    Metrics endpoint is enabled by exposure.include; health does not conflict; server port affects access but not endpoint existence.
  3. Final Answer:

    The application is missing the actuator dependency -> Option C
  4. 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

  1. Step 1: Expose only health and info endpoints publicly

    Use management.endpoints.web.exposure.include=health,info to expose only those endpoints.
  2. Step 2: Secure metrics endpoint separately

    Keep metrics endpoint enabled internally and protect it with authentication or network rules.
  3. Final Answer:

    Set management.endpoints.web.exposure.include=health,info and secure /metrics with authentication -> Option B
  4. 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 unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard