- SpringBoot : 2.4.4
- Java : 11
In 2.x, Actuator keeps its fundamental intent but simplifies its model, extends its capabilities, and incorporates better defaults. First, this version becomes technology-agnostic. It also simplifies its security model by merging it with the application one. Among the various changes, it's important to keep in mind that some of them are breaking. This includes HTTP requests and responses as well as Java APIs. Lastly, the latest version now supports the CRUD model as opposed to the old read/write model.
- BaseURL
http://localhost:8080/actuator
- 어플리케이션에 대한 기본적인 정보를 제공
- Status
- Up : 서버 정상
- Down : DB 연결 문제, 또는 디스크 공간 부족
http://localhost:8080/actuator/health
http://localhost:8080/actuator/metrics
- JVM memory 사용률
- CPU usage
- 메트릭에서 제공해주는 기능들은 많다. 원하는 메트릭을 check할 수 있다.
- 예를 들면 다음과 같다.
http://localhost:8080/actuator/metrics/jvm.buffer.memory.used
- Application log 확인
- Runtime시점에 log level을 바꿀 수도 있음
http://localhost:8080/actuator/loggers
http://localhost:8080/actuator/info
- 기본적으로는 false로 설정되어 있음
- shutdown 엔드포인트는 보안이 중요.
- 만약 노출한다면 꼭 보안을 설정할 것(SpringSecurity)
Unlike in previous versions, Actuator comes with most endpoints disabled. Thus, the only two available by default are /health and /info. If we want to enable all of them, we could set management.endpoints.web.exposure.include=*. Alternatively, we can list endpoints that should be enabled.
Spec에 대해 조사하고 사용할 것(사용법이 다 다름)
/auditeventslists security audit-related events such as user login/logout. Also, we can filter by principal or type among other fields./beansreturns all available beans in our BeanFactory. Unlike/auditevents, it doesn't support filtering./conditions, formerly known as/autoconfig, builds a report of conditions around autoconfiguration./configpropsallows us to fetch all @ConfigurationProperties beans./envreturns the current environment properties. Additionally, we can retrieve single properties./flywayprovides details about our Flyway database migrations./healthsummarizes the health status of our application./heapdumpbuilds and returns a heap dump from the JVM used by our application./inforeturns general information. It might be custom data, build information or details about the latest commit./liquibasebehaves like /flyway but for Liquibase./logfilereturns ordinary application logs./loggersenables us to query and modify the logging level of our application./metricsdetails metrics of our application. This might include generic metrics as well as custom ones./prometheusreturns metrics like the previous one, but formatted to work with a Prometheus server./scheduledtasksprovides details about every scheduled task within our application./sessionslists HTTP sessions given we are using Spring Session./shutdownperforms a graceful shutdown of the application./threaddumpdumps the thread information of the underlying JVM.