Skip to main content
PreparationZone Logo
PrepZone

Actuator Endpoints

Health checks, info, metrics and securing actuator in production.

Pass checkpoint below

Why this matters

  • Kubernetes liveness and readiness probes need a reliable endpoint that returns 200 only when the app can actually handle requests.
  • Custom health indicators let you surface BookStore-specific dependencies: database connectivity, Redis reachability, and payment gateway status.
  • Metrics endpoints feed Prometheus and Grafana dashboards — request rates, error ratios, and JVM memory without writing instrumentation from scratch.

Actuator endpoints

L1 · Fresher

/actuator/health reports liveness; orchestrators use it for probes. Expose only safe endpoints publicly.

Custom health indicators

L2 · Intermediate

Implement HealthIndicator for BookStore dependencies — payment gateway, warehouse API, disk space.

Securing actuator

L3 · Advanced

Require authentication or network policies for /actuator/* in production; never leave env and beans open on the internet.

Kubernetes probes

L4 · Expert

Separate liveness (restart) from readiness (traffic) — readiness should fail when dependencies are down, not liveness.

Logs
Logback + MDCStructured JSON
Metrics
MicrometerCounters, timers
Traces
OpenTelemetryTrace propagation
Logs, metrics and traces — the three pillars wired through Actuator and Micrometer.

Actuator endpoints you will use daily

  • /actuator/health — aggregated health with component breakdown (db, redis, diskSpace).
  • /actuator/metrics — lists available Micrometer meters; append a name for current values.
  • /actuator/info — build metadata from info.* properties and custom InfoContributor beans.
  • /actuator/prometheus — scrape-friendly metrics export when the Prometheus registry is on the classpath.
  • HealthIndicator — implement this interface to add custom checks to the health aggregate.

Add Actuator and expose endpoints

Java
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
Java
management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics,prometheus
  endpoint:
    health:
      show-details: when_authorized
      probes:
        enabled: true  # adds /actuator/health/liveness and /readiness
  info:
    env:
      enabled: true

info:
  app:
    name: BookStore API
    version: 2.4.1

The rest of this guide is part of Pro

Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.

Still to come · 3 sections

  • Custom health for external dependencies
  • Secure actuator in production
  • Endpoints beyond health

Test yourself

Answer these before moving on — recall is what makes it stick.