0Pricing
Spring Boot 4 Microservices & REST APIs · درس

تفعيل نقاط نهاية 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,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/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 يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. تفعيل نقاط نهاية Actuator
  2. مؤشرات الحالة
  3. مقاييس مخصصة باستخدام Micrometer
  4. تأمين نقاط نهاية Actuator
← العودة إلى Spring Boot 4 Microservices & REST APIs