Включение конечных точек Actuator
Добавляйте и открывайте конечные точки Actuator
«Включение конечных точек Actuator» — бесплатный урок Spring Boot 4 Microservices & REST APIs на CoddyKit. Это урок 1 из 4. Ты можешь прочитать весь урок бесплатно ниже — а потом практиковать его прямо в браузере с встроенным редактором кода и ИИ-репетитором 24/7. Это часть пути обучения 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,envExcluding 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,heapdumpEnabling 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: trueThe 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: trueChanging 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/healthA 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: 8081Operational 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; onlyhealthis exposed by default - Control HTTP exposure with
exposure.include/exclude - Enable/disable endpoints individually
- Optionally use a separate management port
Часто задаваемые вопросы
Урок «Включение конечных точек Actuator» бесплатный?
Да — полный текст урока «Включение конечных точек Actuator» бесплатно доступен здесь в веб-версии. Чтобы практиковать его интерактивно (встроенный редактор кода и ИИ-репетитор 24/7) и разблокировать остальной курс Spring Boot 4 Microservices & REST APIs, подпишись на CoddyKit PRO. Курс Spring Boot 4 Microservices & REST APIs содержит 4 уроков всего.
Чему я научусь в уроке «Включение конечных точек Actuator»?
Добавляйте и открывайте конечные точки Actuator Ты практикуешь Spring Boot 4 Microservices & REST APIs с помощью реального кода, который запускаешь прямо в браузере, и ИИ-репетитор 24/7 отвечает на твои вопросы во время урока.
Нужен ли мне опыт, чтобы начать Spring Boot 4 Microservices & REST APIs?
Предыдущий опыт не требуется. Spring Boot 4 Microservices & REST APIs на CoddyKit структурирован для всех уровней — от новичков до продвинутых, поэтому ты можешь начать отсюда или с самого начала и учиться в своем темпе. Это урок 1 из 4.
Сколько времени занимает урок «Включение конечных точек Actuator»?
Большинство уроков CoddyKit занимают около 5–10 минут. Каждый из них компактный и интерактивный, поэтому ты постоянно делаешь прогресс и продолжаешь с того же места в веб-версии и приложении.
Можно ли писать и запускать код в этом уроке Spring Boot 4 Microservices & REST APIs?
Да. Каждый урок Spring Boot 4 Microservices & REST APIs включает встроенный редактор кода, поэтому ты пишешь и запускаешь реальный код прямо в браузере и получаешь моментальную обратную связь от AI — локальная установка не требуется.
Все уроки этого курса
- Включение конечных точек Actuator
- Индикаторы состояния
- Пользовательские метрики с Micrometer
- Защита конечных точек Actuator