Actuator cung cấp production-ready endpoint để expose thông tin app qua HTTP/JMX — không cần viết monitoring code.
Setup:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>management:
endpoints.web.exposure.include: health, metrics, info, prometheus
endpoint.health.show-details: when-authorizedEndpoint chính:
- /actuator/health — Kubernetes liveness/readiness probe.
- /actuator/metrics — performance metrics (CPU, memory, HTTP latency).
- /actuator/prometheus — Prometheus scrape format.
- /actuator/info — build info, git commit.
- /actuator/env — environment variables, properties.
- /actuator/loggers — đổi log level runtime (không restart!).
Quan trọng cho: operational visibility, debugging production, Kubernetes liveness/readiness check, Prometheus + Grafana monitoring.
Bảo mật: endpoint nhạy cảm (/env, /heapdump) phải bảo vệ qua Spring Security hoặc chỉ expose qua port nội bộ.
Actuator provides production-ready endpoints exposing app information via HTTP/JMX — no monitoring code needed.
Setup:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>management:
endpoints.web.exposure.include: health, metrics, info, prometheus
endpoint.health.show-details: when-authorizedKey endpoints:
- /actuator/health — Kubernetes liveness/readiness probe.
- /actuator/metrics — performance metrics (CPU, memory, HTTP latency).
- /actuator/prometheus — Prometheus scrape format.
- /actuator/info — build info, git commit.
- /actuator/env — environment variables, properties.
- /actuator/loggers — change log levels at runtime (no restart!).
Critical for: operational visibility, production debugging, Kubernetes liveness/readiness probes, Prometheus + Grafana monitoring.
Security: sensitive endpoints (/env, /heapdump) must be protected via Spring Security or only exposed on an internal port.