Spring Boot 관측성 예제
최신 안정판 Bluetape4k 1.11.0 릴리스 기준
해결하는 문제
섹션 제목: “해결하는 문제”Spring Boot 4에서 bluetape4k observation helper를 Spring Boot Actuator Prometheus metrics와 애플리케이션 소유 OTLP tracing 설정으로 사용하는 실행 가능한 예제입니다. 이 매뉴얼은 README의 기능 목록을 반복하지 않고 현재 build, source entry point, test, 설정 resource, lifecycle 근거를 연결합니다.
사용 시점
섹션 제목: “사용 시점”애플리케이션에 실행 entry point, 필요한 service, 기대 동작, 예제가 보여 주는 production pattern이 필요할 때 observability-spring-boot-demo를 선택합니다. 아래 source entry point에서 시작해 ownership과 failure 계약이 caller lifecycle에 맞는지 확인합니다. 표준 API나 이미 도입한 더 작은 모듈이 같은 계약을 만족한다면 그쪽을 우선합니다.
의존성 좌표
섹션 제목: “의존성 좌표”이 example project는 Maven artifact로 게시하지 않습니다. 저장소에서 실행하고 명령을 선택하기 전에 Gradle task를 확인합니다.
Gradle project path는 :observability-spring-boot-demo, source directory는 examples/spring-boot/observability-spring-boot-demo입니다.
핵심 개념
섹션 제목: “핵심 개념”먼저 확인할 source 개념은 ObservabilitySpringBootDemoApplication입니다. 파일 이름은 탐색 anchor일 뿐이므로 public 계약으로 사용하기 전에 선언과 test를 함께 읽습니다.
빠른 시작
섹션 제목: “빠른 시작”example이나 benchmark를 실행하기 전에 project task를 확인합니다.
./gradlew :observability-spring-boot-demo:tasks --all그다음 모듈 README에 기록된 명령을 사용하고 필요한 외부 service는 격리합니다.
작업별 API
섹션 제목: “작업별 API”| Entry point | 확인할 내용 |
|---|---|
ObservabilitySpringBootDemoApplication | constructor, function, ownership 계약을 확인합니다. |
권장 패턴
섹션 제목: “권장 패턴”README 근거는 예제 시나리오, Architecture, Sequence Diagram, 의존성, 설정, 실행, 확인, 테스트 순서로 탐색할 수 있습니다. 이 항목으로 방향을 잡고 source와 test에서 동작을 확인합니다. 도입 범위는 좁게 유지하고 소유한 resource를 caller lifecycle에 연결합니다.
현재 build에 선언된 integration edge는 다음과 같습니다.
implementation(platform(libs.spring.boot.dependencies))implementation(project(":bluetape4k-micrometer"))implementation(project(":bluetape4k-spring-boot-core"))implementation("org.springframework.boot:spring-boot-starter-web")implementation("org.springframework.boot:spring-boot-starter-actuator")runtimeOnly(libs.micrometer.registry.prometheus)runtimeOnly(libs.micrometer.tracing.bridge.otel)runtimeOnly(libs.opentelemetry.exporter.otlp)compileOnly edge는 caller가 제공해야 하는 capability이므로 API를 사용하기 전에 runtime에 실제 dependency가 있는지 확인합니다.
모듈에서 찾은 설정 resource는 다음과 같습니다.
override하기 전에 이 resource와 binding source에서 property 이름과 default를 확인합니다.
실패 동작
섹션 제목: “실패 동작”failure 의미는 artifact 이름이 아니라 아래 entry point와 test가 결정합니다. cancellation과 timeout signal을 보존하고 소유한 resource를 닫습니다. backend exception은 안정된 domain 계약을 추가할 수 있는 boundary에서만 변환합니다. retry나 fallback을 넣기 전에 test anchor로 실제 동작을 확인합니다.
격리된 환경에서 example을 실행하고 startup, dependency health, request, shutdown을 확인합니다. capacity, timeout, retry, shutdown 설정은 resource를 소유한 component 가까이에 둡니다. 누가 trade-off를 받아들였는지 알 수 없는 process-wide default는 피합니다.
테스트
섹션 제목: “테스트”모듈 test task는 다음과 같습니다.
./gradlew :observability-spring-boot-demo:test --no-configuration-cache대표 test anchor는 다음과 같습니다.
워크숍
섹션 제목: “워크숍”manual manifest에 등록된 전용 workshop path가 없습니다. 모듈 README와 위 representative test를 실행 근거로 사용합니다.
제한 사항
섹션 제목: “제한 사항”이 페이지는 연결된 source와 test가 나타내는 현재 저장소 상태를 설명합니다. optional backend를 애플리케이션 기본값으로 만들거나 benchmark artifact 없이 성능을 단정하지 않습니다. 모듈 버전이 바뀌면 호환성과 lifecycle 설명을 다시 확인해야 합니다.
배포본 다이어그램
섹션 제목: “배포본 다이어그램”아래 그림은 1.11.0 배포본의 README 자산을 해당 배포 커밋에서 직접 불러옵니다. 이후 SNAPSHOT이 아니라 이 매뉴얼 버전의 구조와 실행 흐름을 보여 줍니다. 미리보기를 누르면 같은 배포 커밋의 SVG 원본이 열립니다.
Spring Boot observability 예제 아키텍처
섹션 제목: “Spring Boot observability 예제 아키텍처”배포본 README: examples/spring-boot/observability-spring-boot-demo/README.ko.md
Spring Boot observability 예제 처리 순서
섹션 제목: “Spring Boot observability 예제 처리 순서”배포본 README: examples/spring-boot/observability-spring-boot-demo/README.ko.md

