0Pricing
Spring Boot 4 Microservices & REST APIs · Lesson

Enabling Actuator Endpoints

Add and expose actuator endpoints.

Enabling Actuator Endpoints is a free Spring Boot 4 Microservices & REST APIs lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Spring Boot 4 Microservices & REST APIs learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

What Actuator Provides

Spring Boot Actuator adds production-ready endpoints that expose the internal state of your running app: health, metrics, environment, beans, mappings, and more.

It turns a black-box service into something you can observe and operate without writing custom plumbing.

Adding the Starter

Enable Actuator by adding a single dependency. Auto-configuration registers the endpoints; no extra code is required.

<!-- pom.xml -->
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

The /actuator Base Path

By default endpoints live under /actuator. Visiting the base path returns a discovery document listing the exposed endpoints and their links.

GET /actuator
# returns links to exposed endpoints: health, info, ...

Default Exposure

Out of the box, only a few endpoints are exposed over HTTP — most notably health. Others exist but are hidden until you opt in, which is a safe default for production.

Exposing More Endpoints

Control HTTP exposure with management.endpoints.web.exposure.include. List specific endpoints by id, or use * to expose all (use with care).

management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics,env

Excluding Endpoints

You can include broadly and then carve out sensitive endpoints with exclude, which takes precedence over include.

management:
  endpoints:
    web:
      exposure:
        include: "*"
        exclude: env,beans,heapdump

Enabling and Disabling Endpoints

Exposure differs from being enabled. An endpoint can be enabled but not exposed. Toggle availability with management.endpoint.<id>.enabled.

management:
  endpoint:
    shutdown:
      enabled: true   # disabled by default
    health:
      enabled: true

The Info Endpoint

The info endpoint surfaces arbitrary metadata about your build. Populate it from application.yml or build-time properties like git and build info.

info:
  app:
    name: orders-service
    version: 2.4.0
management:
  info:
    env:
      enabled: true

Changing the Base Path

You can relocate endpoints by changing management.endpoints.web.base-path, for example to /manage, to fit gateway or routing conventions.

management:
  endpoints:
    web:
      base-path: /manage
# now: /manage/health

A Separate Management Port

For isolation, run Actuator on its own port with management.server.port. This lets you keep operational endpoints off the public application port entirely.

management:
  server:
    port: 8081

Operational Mindset

Actuator is the foundation of observability. Expose what operators need, hide what attackers could abuse, and treat the management surface as part of your security perimeter.

Quick Check

Test your understanding of exposure.

Recap

Actuator makes your app observable.

  • Add spring-boot-starter-actuator
  • Endpoints live under /actuator; only health is exposed by default
  • Control HTTP exposure with exposure.include/exclude
  • Enable/disable endpoints individually
  • Optionally use a separate management port

Frequently asked questions

Is the “Enabling Actuator Endpoints” lesson free?

Yes — the full text of “Enabling Actuator Endpoints” is free to read here on the web, and the Spring Boot 4 Microservices & REST APIs course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Spring Boot 4 Microservices & REST APIs course, upgrade to CoddyKit PRO.

What will I learn in “Enabling Actuator Endpoints”?

Add and expose actuator endpoints. You practise Spring Boot 4 Microservices & REST APIs with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Spring Boot 4 Microservices & REST APIs?

No prior experience is required. Spring Boot 4 Microservices & REST APIs on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Enabling Actuator Endpoints” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Spring Boot 4 Microservices & REST APIs lesson?

Yes. Every Spring Boot 4 Microservices & REST APIs lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Enabling Actuator Endpoints
  2. Health Indicators
  3. Custom Metrics with Micrometer
  4. Securing Actuator Endpoints
← Back to Spring Boot 4 Microservices & REST APIs