STK10-11 청크 전환 시그널 대시보드·알람

작업 내용

STK10-08이 내보내는 메트릭으로 Grafana 대시보드·임계 알람을 구성한다. 임계 지속 초과가 Spring Batch(청크·restart·partition) 전환 신호다 (ADR-006). 옵저버빌리티 스택(STK-OBS) 완료에 의존한다.

  • Grafana 대시보드: 통계별 수집 행수·소요, 배치 전체 소요, 벌크 upsert 소요, 재시도/429, JVM heap(자동계측)
  • 임계 알람 → Discord:
    • 단일 통계 행수 > 50,000 지속
    • 배치 전체 소요 > 5분 / 단일 통계 > 2분
    • 벌크 upsert > 30초
    • heap 사용률 급증·OOM 근접
    • 부분 실패·429 빈발
  • 알람 설명에 “청크 기반(Spring Batch) 전환 검토” 액션 명시

이 티켓은 대시보드/알람 구성(설정)만 다룬다. 메트릭 emission은 STK10-08 소유.

다이어그램

처리 흐름

sequenceDiagram
    participant Batch as MarketFlow batch
    participant Agent as OTel agent
    participant Col as OTel Collector
    participant Prom as Prometheus
    participant Graf as Grafana
    participant Disc as Discord
    Batch->>Agent: Micrometer metrics
    Agent->>Col: OTLP export
    Col->>Prom: metrics
    Graf->>Prom: query
    Graf->>Disc: 임계 초과 알람

클래스 의존

flowchart LR
    Metrics[STK10-08 metrics] --> Collector[OTel Collector]
    Collector --> Prometheus
    Prometheus --> Grafana
    Grafana --> Discord

테스트 케이스

  • 대시보드가 통계별 행수·소요·재시도·heap 패널을 표시한다
  • 단일 통계 행수가 임계를 넘으면 알람이 발화한다
  • 배치 전체 소요가 임계를 넘으면 알람이 발화한다
  • 알람 메시지에 청크 전환 검토 액션이 포함된다
  • 임계 미만 정상 run에서는 알람이 발화하지 않는다