Files
spring-boot-examples/docs/actuator/01_actuator.md
2025-04-08 19:56:24 +09:00

98 lines
2.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
좋아, 1부 "개요와 시작"을 간결하게 작성해볼게. 실무자가 빠르게 이해하고 따라 할 수 있도록 구성하고, 예시는 Gradle 기준으로 쓸게.
---
## **1부. 개요와 시작**
---
### **1장. 스프링 부트 액추에이터란?**
#### 액추에이터의 개요
- 스프링 부트 액추에이터(Spring Boot Actuator)는 애플리케이션의 상태, 성능, 메트릭, 로그 설정 등을 HTTP 엔드포인트로 노출하여 운영·모니터링을 쉽게 할 수 있도록 도와주는 기능이다.
#### 주요 기능
- Health 체크
- 애플리케이션 정보 출력
- 메트릭 수집 (CPU, 메모리, 요청 수 등)
- HTTP 요청 추적
- 로깅 레벨 변경
- 사용자 정의 엔드포인트 구현
---
### **2장. 프로젝트 설정**
#### Gradle 설정 예시
```kotlin
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-web'
}
```
#### 애플리케이션 실행
```bash
./gradlew bootRun
```
실행 후 `http://localhost:8080/actuator` 접속
---
### **3장. 기본 엔드포인트 살펴보기**
#### 엔드포인트 목록
- `/actuator/health` 애플리케이션 상태 확인
- `/actuator/info` 앱 정보 출력
- `/actuator/metrics` 메트릭 데이터
- `/actuator/loggers` 로깅 레벨 제어
- `/actuator/beans` 빈 목록 출력
- `/actuator/env` 환경 변수 출력
#### application.yml 설정 예시
```yaml
management:
endpoints:
web:
exposure:
include: "*"
```
> 기본적으로 대부분의 엔드포인트는 비공개이며, 위 설정으로 전체 노출 가능.
---
### **4장. 엔드포인트 테스트하기**
#### curl로 확인
```bash
curl http://localhost:8080/actuator/health
```
#### 결과 예시
```json
{
"status": "UP"
}
```
---
### **5장. 요약**
- 액추에이터는 스프링 부트에서 운영 편의성을 높이는 핵심 도구다.
- 별도 서버 설치 없이 엔드포인트를 통해 상태, 성능, 설정 정보를 쉽게 확인할 수 있다.
- Gradle로 간단히 의존성을 추가하고, `application.yml`로 노출 설정을 제어할 수 있다.
---
원하면 각 장에 더 많은 설명이나 예제를 추가해줄 수 있어. 다음은 2부 주요 엔드포인트 설명 들어가면 좋을 것 같아. 계속 이어서 쓸까?