0Pricing
Spring Boot 4 Microservices & REST APIs · Lección

Habilitar endpoints de Actuator

Añada y exponga endpoints de Actuator

Habilitar endpoints de Actuator es una lección gratuita de Spring Boot 4 Microservices & REST APIs en CoddyKit. Esta es la lección 1 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de Spring Boot 4 Microservices & REST APIs, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de Spring Boot 4 Microservices & REST APIs incluye 4 lecciones en total.

Partes de esta lección aún no han sido traducidas y se muestran en inglés.

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

Preguntas frecuentes

¿La lección «Habilitar endpoints de Actuator» es gratis?

Sí — el texto completo de «Habilitar endpoints de Actuator» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de Spring Boot 4 Microservices & REST APIs, actualiza a CoddyKit PRO. El curso de Spring Boot 4 Microservices & REST APIs incluye 4 lecciones en total.

¿Qué aprenderé en «Habilitar endpoints de Actuator»?

Añada y exponga endpoints de Actuator Practicas Spring Boot 4 Microservices & REST APIs con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.

¿Necesito experiencia previa para empezar Spring Boot 4 Microservices & REST APIs?

No se requiere experiencia previa. Spring Boot 4 Microservices & REST APIs en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 1 de 4.

¿Cuánto tiempo toma la lección «Habilitar endpoints de Actuator»?

La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.

¿Puedo escribir y ejecutar código en esta lección de Spring Boot 4 Microservices & REST APIs?

Sí. Cada lección de Spring Boot 4 Microservices & REST APIs incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.

Todas las lecciones de este curso

  1. Habilitar endpoints de Actuator
  2. Indicadores de salud
  3. Métricas personalizadas con Micrometer
  4. Proteger endpoints de Actuator
← Volver a Spring Boot 4 Microservices & REST APIs