Lesson 16 · Spring Boot · completes the course 🎓

Spring Boot Actuator

Production-ready endpoints for health, metrics and info — and the exposure rules the exam loves to test.

What you'll be tested on The difference between an endpoint being enabled vs exposed; the default exposure over HTTP vs JMX; how to expose more; the health statuses and how to customise health and metrics.

What Actuator gives you

Add spring-boot-starter-actuator and Boot exposes endpoints that report on and let you manage a running app — health, info, metrics, beans, env, loggers, mappings, threaddump, shutdown, and more. Over HTTP they live under the base path /actuator (e.g. /actuator/health).

Enabled vs exposed — the key distinction

Every endpoint has two independent switches:

ConcernMeansDefault
Enabledthe endpoint bean exists at allAll enabled except shutdown
Exposed (HTTP)reachable over the webOnly health
Exposed (JMX)reachable over JMXAll endpoints
The classic exam question Over HTTP, only health is exposed by default. Over JMX, all endpoints are. An endpoint can be enabled but not exposed — it exists, but you can't reach it over HTTP until you include it. And shutdown is the one endpoint disabled by default.

Exposing more endpoints

# expose everything over HTTP
management.endpoints.web.exposure.include=*

# or a specific set, and exclude some
management.endpoints.web.exposure.include=health,info,metrics
management.endpoints.web.exposure.exclude=env,beans

The health endpoint

@Component
public class QueueHealthIndicator implements HealthIndicator {
  @Override public Health health() {
    return queueOk() ? Health.up().build()
                     : Health.down().withDetail("queue", "full").build();
  }
}

Metrics & securing endpoints

Primary source — read this
Spring Boot 2.5 — Actuator: Exposing Endpoints, Health & Metrics

Read "Enabling/Exposing Endpoints" (the default table), "Health Information", and "Metrics".

Check yourself

The exposure defaults and the enabled-vs-exposed distinction are the money questions. All answers verified against the Boot 2.5 docs. Options shuffle on every load.

🎓 That's the whole course You've now covered all six exam sections — Core, Data, MVC, Testing, Security, and Boot (with Actuator). Second pass: your book's Boot Actuator section. Then move to the full-length mock in the book.
I'm your teacher — ask me anything. Now take the Full Mock Exam → — 60 questions, a 130-minute timer, all six sections, scored under real conditions. Tell me your weakest section and I'll drill it. And when you sit the exam — good luck. You've earned the confidence.
← Lesson 15 · Spring Boot Back to Dashboard →