0Pricing
Spring Boot 4 Microservices & REST APIs · Aula

Habilitando endpoints do Actuator

Adicione e exponha endpoints do Actuator.

Habilitando endpoints do Actuator é uma aula grátis de Spring Boot 4 Microservices & REST APIs no CoddyKit. Esta é a aula 1 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Spring Boot 4 Microservices & REST APIs, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Spring Boot 4 Microservices & REST APIs inclui 4 aulas no total.

Partes desta aula ainda não foram traduzidas e aparecem em 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

Perguntas Frequentes

A aula “Habilitando endpoints do Actuator” é grátis?

Sim — o texto completo de “Habilitando endpoints do Actuator” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Spring Boot 4 Microservices & REST APIs, atualize para CoddyKit PRO. O curso de Spring Boot 4 Microservices & REST APIs inclui 4 aulas no total.

O que vou aprender em “Habilitando endpoints do Actuator”?

Adicione e exponha endpoints do Actuator. Você pratica Spring Boot 4 Microservices & REST APIs com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.

Preciso ter experiência prévia para começar Spring Boot 4 Microservices & REST APIs?

Nenhuma experiência prévia é necessária. Spring Boot 4 Microservices & REST APIs no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 1 de 4.

Quanto tempo leva a aula “Habilitando endpoints do Actuator”?

A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.

Posso escrever e executar código nesta aula de Spring Boot 4 Microservices & REST APIs?

Sim. Cada aula de Spring Boot 4 Microservices & REST APIs inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.

Todas as aulas deste curso

  1. Habilitando endpoints do Actuator
  2. Indicadores de saúde
  3. Métricas personalizadas com Micrometer
  4. Protegendo endpoints do Actuator
← Voltar para Spring Boot 4 Microservices & REST APIs