0Pricing
Spring Boot 4 Microservices & REST APIs · レッスン

Actuatorエンドポイントを有効にする

Actuatorエンドポイントを追加して公開します

「Actuatorエンドポイントを有効にする」はCoddyKit上の無料Spring Boot 4 Microservices & REST APIsレッスンです。 これはレッスン1/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはSpring Boot 4 Microservices & REST APIs学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Spring Boot 4 Microservices & REST APIsコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

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

よくある質問

「Actuatorエンドポイントを有効にする」レッスンは無料ですか?

はい。「Actuatorエンドポイントを有効にする」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Spring Boot 4 Microservices & REST APIsコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Spring Boot 4 Microservices & REST APIsコースには全4レッスンが含まれています。

「Actuatorエンドポイントを有効にする」で何を学びますか?

Actuatorエンドポイントを追加して公開します ブラウザで直接実行するハンズオンコードでSpring Boot 4 Microservices & REST APIsを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Spring Boot 4 Microservices & REST APIsを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのSpring Boot 4 Microservices & REST APIsは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン1/4です。

「Actuatorエンドポイントを有効にする」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このSpring Boot 4 Microservices & REST APIsレッスンでコードを書いて実行できますか?

はい。すべてのSpring Boot 4 Microservices & REST APIsレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. Actuatorエンドポイントを有効にする
  2. ヘルスインジケーター
  3. Micrometerでカスタムメトリクスを作る
  4. Actuatorエンドポイントを保護する
← Spring Boot 4 Microservices & REST APIsに戻る