Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive monitoring stack including Prometheus, Loki, Promtail, Jaeger, and Grafana, alongside OpenTelemetry integration for automated tracing. It also optimizes the StoreRemain slot generation logic by implementing pre-calculated slot plans and using interface projections to improve database query efficiency. Security improvements include restricting external access to Actuator endpoints via Nginx. Review feedback suggests evaluating alternative Garbage Collectors (Serial or Parallel) for the small heap size, mitigating security risks by avoiding the root user for the Jaeger container, and implementing null checks before parsing store operating hours to prevent potential exceptions.
| ENV JAVA_TOOL_OPTIONS="-XX:MaxRAMPercentage=70.0 -XX:InitialRAMPercentage=50.0" | ||
| # t3.small 환경 고려한 JVM 메모리 튜닝 + OTel Agent 자동 활성화 | ||
| # OTEL_EXPORTER_OTLP_ENDPOINT가 설정 안 되면 트레이스 전송만 실패할 뿐 앱은 정상 동작 | ||
| ENV JAVA_TOOL_OPTIONS="-javaagent:/opentelemetry-javaagent.jar -XX:MaxRAMPercentage=70.0 -XX:InitialRAMPercentage=50.0 -XX:+UseG1GC" |
There was a problem hiding this comment.
While -XX:+UseG1GC is the default in Java 21, explicitly setting it for a container limited to 600MB (as seen in docker-compose.prod.yml) might not be optimal. G1GC is generally more effective for larger heaps. For a heap size around 400MB (70% of 600MB), you might consider testing SerialGC or ParallelGC to see if they provide better performance with lower overhead in this resource-constrained environment.
| jaeger: | ||
| image: jaegertracing/all-in-one:1.62.0 | ||
| container_name: catchtable-jaeger | ||
| user: "0" # named volume mkdir 퍼미션 회피 (내부 도구라 보안 영향 없음) |
There was a problem hiding this comment.
| LocalTime openTime = LocalTime.parse(store.getOpenTime(), TIME_FORMATTER); | ||
| LocalTime closeTime = LocalTime.parse(store.getCloseTime(), TIME_FORMATTER); |
There was a problem hiding this comment.
The LocalTime.parse method will throw a NullPointerException if store.getOpenTime() or store.getCloseTime() returns null. Although there is a catch block, it is safer and more idiomatic to perform a null check before parsing to avoid unnecessary exception overhead.
String openTimeStr = store.getOpenTime();
String closeTimeStr = store.getCloseTime();
if (openTimeStr == null || closeTimeStr == null) {
log.warn("[영업시간 누락] storeId={}", store.getId());
continue;
}
LocalTime openTime = LocalTime.parse(openTimeStr, TIME_FORMATTER);
LocalTime closeTime = LocalTime.parse(closeTimeStr, TIME_FORMATTER);
📢 기능 설명
필요시 실행결과 스크린샷 첨부
연결된 issue
연결된 issue를 자동을 닫기 위해 아래 {이슈넘버}를 입력해주세요.
close #{이슈넘버}
✅ 체크리스트