Skip to content

[HSC-424] 로그 feature 배치 엔드포인트 추가#284

Merged
tkv00 merged 2 commits into
mainfrom
perf/HSC-424
Apr 1, 2026
Merged

[HSC-424] 로그 feature 배치 엔드포인트 추가#284
tkv00 merged 2 commits into
mainfrom
perf/HSC-424

Conversation

@tkv00
Copy link
Copy Markdown
Contributor

@tkv00 tkv00 commented Apr 1, 2026

📝작업 내용

  • admin 내부 로그 feature 배치 엔드포인트 추가
  • customer outbox 배치 전송 적용
  • 배치 전송 메트릭 추가
  • 배치 전송 테스트 추가

👀변경 사항

  • /internal/v1/log-features/batch 경로 추가
  • memberId + Asia/Seoul 기준일 단위 그룹 전송
  • 배치 요청 단위 ack/retry 처리
  • mode=single|batch 태그 추가
  • batch size 메트릭 추가
flowchart LR
    A["Customer User Log"] --> B["Outbox 적재"]
    B --> C["memberId + KST 기준일 그룹화"]
    C --> D["POST /internal/v1/log-features/batch"]
    D --> E["Admin LogFeaturesUseCase"]
    E --> F["Feature Snapshot 동기화"]
    F --> G["Churn Snapshot 저장"]

Loading

🎫 Jira Ticket

  • Jira Ticket: HSC-424

#️⃣관련 이슈


@tkv00 tkv00 added 🗂️ area: BE 백엔드 영역 🔥 priority: P0 즉시 처리 필요(서비스/데모 블로커) ⚡ perf 성능 개선(쿼리/캐시/병목 제거 등) 🏷️ release 릴리즈 준비/버전 태깅/릴리즈 노트/릴리즈 브랜치 작업 release:patch 버전 patch bump: X.Y.(Z+1) deploy:api-server 배포 대상: customer-api Customer Team labels Apr 1, 2026
@github-actions github-actions Bot added 🐛 fix 기능에 대한 버그 수정 🚑 hotfix 프로덕션 긴급 수정(우회/긴급 패치 포함) labels Apr 1, 2026
@github-actions github-actions Bot changed the title 로그 feature 배치 엔드포인트 추가 [HSC-424] 로그 feature 배치 엔드포인트 추가 Apr 1, 2026
@tkv00 tkv00 merged commit 4d24fae into main Apr 1, 2026
11 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 1, 2026

🧪 Test Coverage Report (JaCoCo)

overall__line overall__branch changed__line changed__branch

기준(soft, workflow는 실패 안 함): Overall line 70% / branch 50%, Changed line 80% / branch 60% · Generated: 2026-04-01 09:44 UTC

Scope Line Branch Line Graph Branch Graph Verdict
Overall 39.7% 28.2% ████████░░░░░░░░░░░░ ██████░░░░░░░░░░░░░░ ⚠️⚠️
Changed 18.1% 13.8% ████░░░░░░░░░░░░░░░░ ███░░░░░░░░░░░░░░░░░ ⚠️⚠️

Package line spark (sample): ▃▂▁▂▂▄▄·▇█▁▆▆▆·▆▁▂▆█▇▃▁▁▁██▁▁▃
Package branch spark (sample): ▃▁·▁▁·▁·▇··▅▆▅·▅▁▂▅▇▇▂▁·▁·█▁▁▁

📦 Package coverage (worst 10)

Rank Package Line Branch Lines Line Graph Branch Graph
1 site.holliverse.shared.monitoring 0.0% N/A 101 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
2 site.holliverse.customer.coupon.application 0.0% 0.0% 61 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
3 site.holliverse.infra.kafka.consumer 0.0% 0.0% 44 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
4 site.holliverse.customer.integration.fastapi 0.0% 0.0% 28 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
5 site.holliverse.customer.application.usecase.counsel 0.0% 0.0% 14 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
6 site.holliverse.customer.coupon.web 0.0% 0.0% 12 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
7 site.holliverse.shared.config.runtime 0.0% N/A 11 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
8 site.holliverse.customer.web.util 0.0% 0.0% 8 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
9 site.holliverse.auth.handler 0.0% N/A 8 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
10 site.holliverse.admin.domain.model.churn.feature 0.0% N/A 8 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░

🧨 Lowest coverage classes (worst 10)

Rank Class Line Branch Lines Line Graph Branch Graph
1 site.holliverse.shared.monitoring.CustomerMetrics 0.0% N/A 74 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
2 site.holliverse.customer.application.usecase.log.UserLogService 0.0% 0.0% 55 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
3 site.holliverse.infra.kafka.consumer.RecommendationKafkaConsumer 0.0% 0.0% 44 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
4 site.holliverse.customer.application.usecase.recommendation.RecommendationKafkaConsumeUseCase 0.0% 0.0% 42 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
5 site.holliverse.admin.application.usecase.CalculateLogChurnScoreService 0.0% 0.0% 38 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
6 site.holliverse.admin.application.usecase.CalculateChurnScoreService 0.0% 0.0% 37 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
7 site.holliverse.customer.coupon.application.UseMemberCouponUseCase 0.0% 0.0% 34 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
8 site.holliverse.admin.application.usecase.ChurnRiskReason$ReasonCode 0.0% 0.0% 31 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
9 site.holliverse.customer.integration.fastapi.FastApiRecommendationClient 0.0% 0.0% 28 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
10 site.holliverse.shared.monitoring.CustomerMonitoringBinder 0.0% N/A 27 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
🧩 Changed files coverage breakdown (7 files)
File Line Branch Lines Verdict Line Graph Branch Graph
src/main/java/site/holliverse/shared/monitoring/CustomerMetrics.java 0.0% N/A 74 ⚠️ ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
src/main/java/site/holliverse/customer/application/usecase/log/UserLogAdminDispatchOutboxStateService.java 2.3% 0.0% 44 ⚠️⚠️ ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
src/main/java/site/holliverse/customer/integration/external/AdminLogFeaturesClient.java 3.8% 0.0% 53 ⚠️⚠️ █░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
src/main/java/site/holliverse/customer/application/usecase/log/UserLogAdminDispatchOutboxService.java 29.6% 16.7% 71 ⚠️⚠️ ██████░░░░░░░░░░░░░░ ███░░░░░░░░░░░░░░░░░
src/main/java/site/holliverse/customer/application/usecase/log/AdminLogFeatureDispatchService.java 87.5% 66.7% 24 ✅✅ ██████████████████░░ █████████████░░░░░░░
src/main/java/site/holliverse/admin/web/controller/InternalLogFeatureController.java 100.0% N/A 4 ✅✅ ████████████████████ ░░░░░░░░░░░░░░░░░░░░
src/main/java/site/holliverse/customer/config/AdminLogFeaturesProperties.java N/A N/A 0 ✅✅ ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░

🔎 HTML 리포트: Actions → Artifacts → jacoco-html · XML: jacoco-xml

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이번 풀요청은 로그 feature 전송 성능 개선을 위해 배치 처리 기능을 도입합니다. UserLogAdminDispatchOutboxService에서 로그를 멤버 ID 및 KST 기준일 단위로 그룹화하여 전송하도록 로직을 고도화하였으며, 이를 지원하기 위한 배치용 API 엔드포인트와 클라이언트 기능이 추가되었습니다. 리뷰 과정에서 InternalLogFeatureController의 배치 엔드포인트 경로가 프로젝트 아키텍처 표준인 /api/{version}/admin/... 형식을 위반하는 것으로 확인되어, 보안 및 일관성 유지를 위한 경로 수정이 필요합니다.

return ResponseEntity.accepted().build();
}

@PostMapping("/batch")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

🛑 아키텍처 규칙 위반 (Blocking Issue)

[위반 규칙]: Admin API Path Structure
[문제 이유]: 관리자(Admin) 엔드포인트는 반드시 /api/{version}/admin/... 형식을 따라야 하며, 버전 세그먼트가 'admin'보다 앞에 위치해야 합니다. 현재 설정된 /internal/v1/log-features/batch는 이 표준을 위반하며, 이는 관리자 API를 전용 보안 전략으로 보호하려는 설계와 충돌합니다.
[해결 제안]: 컨트롤러의 @RequestMapping/api/v1/admin/log-features로 변경하여 아키텍처 표준을 준수하십시오.

References
  1. Admin API endpoints should follow the path structure /api/{version}/admin/..., with the version preceding the 'admin' segment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗂️ area: BE 백엔드 영역 Customer Team deploy:api-server 배포 대상: customer-api 🐛 fix 기능에 대한 버그 수정 🚑 hotfix 프로덕션 긴급 수정(우회/긴급 패치 포함) ⚡ perf 성능 개선(쿼리/캐시/병목 제거 등) 🔥 priority: P0 즉시 처리 필요(서비스/데모 블로커) release:patch 버전 patch bump: X.Y.(Z+1) 🏷️ release 릴리즈 준비/버전 태깅/릴리즈 노트/릴리즈 브랜치 작업

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant